PHP Класс lithium\console\command\Route

Наследование: extends lithium\console\Command
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$env string For example: sh li3 route --env=production li3 route show /foo --env=test

Открытые методы

Метод Описание
__construct ( array $config = [] ) Constructor. Load the routes file and set the environment.
all ( $scope = true ) : void Lists all connected routes to the router. This is a convenience alias for the show() method.
run ( ) : void Lists all connected routes to the router. See the all() method for details and examples.
show ( ) : void Returns the corresponding params for a given URL and an optional request method.

Защищенные методы

Метод Описание
_init ( )

Описание методов

__construct() публичный Метод

Constructor. Load the routes file and set the environment.
public __construct ( array $config = [] )
$config array The default configuration, wherein the absolute path to the routes file to load may be specified, using the `'routes'` key.

_init() защищенный Метод

protected _init ( )

all() публичный Метод

Example: sh li3 route li3 route all Will return an output similar to: Template Params -------- ------ {"controller":"pages","action":"view"} pages/{:args} {"controller":"pages","action":"view"} {:slug:[\w\-]+} {"controller":"posts","action":"show"} {:controller}/{:action}/{:args} {"action":"index"}
public all ( $scope = true ) : void
Результат void

run() публичный Метод

Lists all connected routes to the router. See the all() method for details and examples.
public run ( ) : void
Результат void

show() публичный Метод

Examples: 1: li3 route show /foo 2: li3 route show post /foo/bar/1 3: li3 route show /test 4: li3 route show /test --env=production Will return outputs similar to: 1: {"controller":"foo","action":"index" } 2: {"controller":"foo","action":"bar","args":["1"]} 3: {"controller":"lithium\\test\\Controller","action":"index"} 4: {"controller":"test","action":"index"}
public show ( ) : void
Результат void

Описание свойств

$env публичное свойство

For example: sh li3 route --env=production li3 route show /foo --env=test
public string $env
Результат string