Class NRoute


The bidirectional route is responsible for mapping HTTP request to a PresenterRoute object for dispatch and vice-versa.

NObject
   |
   --NRoute

Implements interfaces:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Application/Routers/Route.php (line 36)
Public Method Summary
NRoute
__construct (string $mask, [$metadata = array()], [int $flags = 0])
static void
addStyle (string $style, [string $parent = '#'], void 2)
Creates new style.
string|NULL
constructUrl (NPresenterRequest $appRequest, $httpRequest)
Constructs absolute URL from NPresenterRequest object.
array
Returns default values.
string
getMask ()
Returns mask.
string|FALSE
Proprietary cache aim.
NPresenterRequest|NULL
match ($httpRequest)
Maps HTTP request to a NPresenterRequest object.
static void
setStyleProperty (string $style, string $key, mixed $value, void 3)
Changes style property value.
Methods Inherited From NObject
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Constant Summary
int CASE_SENSITIVE 256

line 42

flag
string FILTER_IN 'filterIn'

line 54

key used in NRoute::$styles or metadata NRoute::__construct
string FILTER_OUT 'filterOut'

line 55

key used in NRoute::$styles or metadata NRoute::__construct
string FILTER_TABLE 'filterTable'

line 56

key used in NRoute::$styles or metadata NRoute::__construct
int FULL_META 128

line 43

int HOST 1

line 46

uri type
string MODULE_KEY 'module'

line 39

int PATH 2

line 47

uri type
string PATTERN 'pattern'

line 53

key used in NRoute::$styles or metadata NRoute::__construct
string PRESENTER_KEY 'presenter'

line 38

int RELATIVE 3

line 48

uri type
string VALUE 'value'

line 52

key used in NRoute::$styles or metadata NRoute::__construct
Variable Summary
static bool $defaultFlags 0

line 66

protected int $flags

line 119

protected array $metadata array()

line 110

of [value & fixity, filterIn, filterOut]
static array $styles array( '#' => array( // default style for path parameters self::PATTERN => '[^/]+',...

line 69

protected int $type

line 116

HOST, PATH, RELATIVE
protected array $xlat

line 113


Method Details

line 128

__construct

public NRoute __construct (string $mask, [$metadata = array()], [int $flags = 0])

Input
string $mask URL mask, e.g. '<presenter>/<action>/<id \d{1,3}>'
$metadata default values or metadata
int $flags flags
Output
NRoute  

line 708

addStyle

public static void addStyle (string $style, [string $parent = '#'], void 2)

Creates new style.

Input
string $style style name (#style, urlParameter, ?queryParameter)
string $parent optional parent style name
void 2
Output
void  

line 259

constructUrl

public string|NULL constructUrl (NPresenterRequest $appRequest, $httpRequest)

Constructs absolute URL from NPresenterRequest object.

Implementation of:

Input
NPresenterRequest $appRequest
$httpRequest
Output
string|NULL  

line 558

getDefaults

public array getDefaults ()

Returns default values.

Output
array  

line 547

getMask

public string getMask ()

Returns mask.

Output
string  

line 579

getTargetPresenter

public string|FALSE getTargetPresenter ()

Proprietary cache aim.

Output
string|FALSE  

line 146

match

public NPresenterRequest|NULL match ($httpRequest)

Maps HTTP request to a NPresenterRequest object.

Implementation of:

Input
$httpRequest
Output
NPresenterRequest|NULL  

line 734

setStyleProperty

public static void setStyleProperty (string $style, string $key, mixed $value, void 3)

Changes style property value.

Input
string $style style name (#style, urlParameter, ?queryParameter)
string $key property name (NRoute::PATTERN, NRoute::FILTER_IN, NRoute::FILTER_OUT, NRoute::FILTER_TABLE)
mixed $value property value
void 3
Output
void