Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • CliRouter
  • Route
  • RouteList
  • SimpleRouter
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class Route

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

Nette\Application\Routers\Route implements Nette\Application\IRouter uses Nette\SmartObject
Namespace: Nette\Application\Routers
Located at Application/Routers/Route.php
Methods summary
public
# __construct( string $mask, array|string|Closure $metadata = [], integer $flags = 0 )

Parameters

$mask
mask, e.g. '<presenter>/<action>/<id \d{1,3}>'
$metadata
values or metadata or callback for NetteModule\MicroPresenter
$flags
flags
public Nette\Application\Request|null
# match( Nette\Http\IRequest $httpRequest )

Maps HTTP request to a Request object.

Maps HTTP request to a Request object.

Returns

Nette\Application\Request|null
Nette\Application\Request|null

Implementation of

Nette\Application\IRouter::match()
public string|null
# constructUrl( Nette\Application\Request $appRequest, Nette\Http\Url $refUrl )

Constructs absolute URL from Request object.

Constructs absolute URL from Request object.

Returns

string|null
string|null

Implementation of

Nette\Application\IRouter::constructUrl()
public string
# getMask( )

Returns mask.

Returns mask.

Returns

string
string
public array
# getDefaults( )

Returns default values.

Returns default values.

Returns

array
array
public integer
# getFlags( )

Returns flags.

Returns flags.

Returns

integer
int
public string[]|null
# getTargetPresenters( )

Proprietary cache aim.

Proprietary cache aim.

Returns

string[]|null
string[]|null

Internal

public static string
# action2path( string $s )

camelCaseAction name -> dash-separated.

camelCaseAction name -> dash-separated.

Parameters

$s

Returns

string
string
public static string
# path2action( string $s )

dash-separated -> camelCaseAction name.

dash-separated -> camelCaseAction name.

Parameters

$s

Returns

string
string
public static string
# presenter2path( string $s )

PascalCase:Presenter name -> dash-and-dot-separated.

PascalCase:Presenter name -> dash-and-dot-separated.

Parameters

$s

Returns

string
string
public static string
# path2presenter( string $s )

dash-and-dot-separated -> PascalCase:Presenter name.

dash-and-dot-separated -> PascalCase:Presenter name.

Parameters

$s

Returns

string
string
public static string
# param2path( string $s )

Url encode.

Url encode.

Parameters

$s

Returns

string
string
Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string PRESENTER_KEY
#'presenter'
string MODULE_KEY
#'module'
integer HOST

Internal

url type
#1
integer PATH

Internal

url type
#2
integer RELATIVE

Internal

url type
#3
string VALUE

key used in Nette\Application\Routers\Route::$styles or metadata Nette\Application\Routers\Route::__construct()

key used in Nette\Application\Routers\Route::$styles or metadata Nette\Application\Routers\Route::__construct()

#'value'
string PATTERN
#'pattern'
string FILTER_IN
#'filterIn'
string FILTER_OUT
#'filterOut'
string FILTER_TABLE
#'filterTable'
string FILTER_STRICT
#'filterStrict'
integer OPTIONAL

Internal

fixity types - how to handle default value? Route::$metadata
#0
integer PATH_OPTIONAL

Internal

fixity types - how to handle default value? Route::$metadata
#1
integer CONSTANT

Internal

fixity types - how to handle default value? Route::$metadata
#2
Constants inherited from Nette\Application\IRouter
ONE_WAY, SECURED
Properties summary
public static integer $defaultFlags

Deprecated

#0
public static array $styles
#[ '#' => [ // default style for path parameters self::PATTERN => '[^/]+', self::FILTER_OUT => [__CLASS__, 'param2path'], ], '?#' => [// default style for query parameters ], 'module' => [ self::PATTERN => '[a-z][a-z0-9.-]*', self::FILTER_IN => [__CLASS__, 'path2presenter'], self::FILTER_OUT => [__CLASS__, 'presenter2path'], ], 'presenter' => [ self::PATTERN => '[a-z][a-z0-9.-]*', self::FILTER_IN => [__CLASS__, 'path2presenter'], self::FILTER_OUT => [__CLASS__, 'presenter2path'], ], 'action' => [ self::PATTERN => '[a-z][a-z0-9-]*', self::FILTER_IN => [__CLASS__, 'path2action'], self::FILTER_OUT => [__CLASS__, 'action2path'], ], '?module' => [ ], '?presenter' => [ ], '?action' => [ ], ]
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0