Class NRoute
The bidirectional route is responsible for mapping HTTP request to a PresenterRequest object for dispatch and vice-versa.
public
|
#
__construct(
string
$mask,
array|string
$metadata = array (
),
int
$flags = 0
)
Parameters$mask string URL mask, e.g. '<presenter>/<action>/<id \d{1,3}>'$metadata array|string default values or metadata$flags int flags |
public
NPresenterRequest|NULL
|
#
match(
IHttpRequest
$httpRequest
)
Maps HTTP request to a PresenterRequest object. Maps HTTP request to a PresenterRequest object. Parameters$httpRequest IHttpRequestImplementation of |
public
string|NULL
|
#
constructUrl(
NPresenterRequest
$appRequest,
NUri
$refUri
)
Constructs absolute URL from PresenterRequest object. Constructs absolute URL from PresenterRequest object. Parameters$appRequest NPresenterRequest$refUri NUriImplementation of |
public
string
|
#
getMask(
)
Returns mask. Returns mask. |
public
array
|
#
getDefaults(
)
Returns default values. Returns default values. |
public
string|FALSE
|
#
getTargetPresenter(
)
Proprietary cache aim. Proprietary cache aim. |
public static
void
|
#
addStyle(
string
$style,
string
$parent = '#'
)
Creates new style. Creates new style. Parameters$style string style name (#style, urlParameter, ?queryParameter)$parent string optional parent style name |
public static
void
|
#
setStyleProperty(
string
$style,
string
$key,
mixed
$value
)
Changes style property value. Changes style property value. Parameters$style string style name (#style, urlParameter, ?queryParameter)$key string property name (NRoute::PATTERN, NRoute::FILTER_IN, NRoute::FILTER_OUT, NRoute::FILTER_TABLE)$value mixed property value |
Methods Inherited From NObject
getReflection(), __call(), __callStatic(), extensionMethod(), __get(), __set(), __isset(), __unset()
PRESENTER_KEY |
'presenter' # |
MODULE_KEY |
'module' # |
CASE_SENSITIVE |
256 # |
HOST |
1 # |
PATH |
2 # |
RELATIVE |
3 # |
VALUE |
'value' # |
PATTERN |
'pattern' # |
FILTER_IN |
'filterIn' # |
FILTER_OUT |
'filterOut' # |
FILTER_TABLE |
'filterTable' # |
OPTIONAL |
0 # |
PATH_OPTIONAL |
1 # |
CONSTANT |
2 # |
ONE_WAY |
1 # |
SECURED |
2 # |
static
bool
|
$defaultFlags | 0 |
# |
static
array
|
$styles | array ( '#' => array ( 'pattern' => '[^/]+', 'filterIn' => 'rawurldecode', 'filterOut' => 'rawurlencode', ), '?#' => array ( ), 'module' => array ( 'pattern' => '[a-z][a-z0-9.-]*', 'filterIn' => array ( 0 => 'NRoute', 1 => 'path2presenter', ), 'filterOut' => array ( 0 => 'NRoute', 1 => 'presenter2path', ), ), 'presenter' => array ( 'pattern' => '[a-z][a-z0-9.-]*', 'filterIn' => array ( 0 => 'NRoute', 1 => 'path2presenter', ), 'filterOut' => array ( 0 => 'NRoute', 1 => 'presenter2path', ), ), 'action' => array ( 'pattern' => '[a-z][a-z0-9-]*', 'filterIn' => array ( 0 => 'NRoute', 1 => 'path2action', ), 'filterOut' => array ( 0 => 'NRoute', 1 => 'action2path', ), ), '?module' => array ( ), '?presenter' => array ( ), '?action' => array ( ), ) |
# |