PHP Интерфейс ManaPHP\Mvc\RouterInterface

Показать файл Открыть проект

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

Метод Описание
getActionName ( ) : string Returns processed action name
getControllerName ( ) : string Returns processed controller name
getModuleName ( ) : string Returns processed module name
getModules ( ) : array
getParams ( ) : array Returns processed extra params
getRewriteUri ( ) : string Get rewrite info. This info is read from $_GET['_url'] or _SERVER["REQUEST_URI"].
handle ( string $uri = null, string $host = null, boolean $silent = true ) : boolean Handles routing information received from the rewrite engine
mount ( string | ManaPHP\Mvc\Router\GroupInterface $group, string $path = null ) : static Mounts a group of routes in the router
removeExtraSlashes ( boolean $remove ) : static Set whether router must remove the extra slashes in the handled routes
wasMatched ( ) : boolean Check if the router matches any of the defined routes

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

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

Returns processed action name
public getActionName ( ) : string
Результат string

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

Returns processed controller name
public getControllerName ( ) : string
Результат string

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

Returns processed module name
public getModuleName ( ) : string
Результат string

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

public getModules ( ) : array
Результат array

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

Returns processed extra params
public getParams ( ) : array
Результат array

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

Get rewrite info. This info is read from $_GET['_url'] or _SERVER["REQUEST_URI"].
public getRewriteUri ( ) : string
Результат string

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

$router->handle(); //==>$router->handle($_GET['_url'],$_SERVER['HTTP_HOST']); $router->handle('/blog'); //==>$router->handle('/blog',$_SERVER['HTTP_HOST']); $router->handle('/blog','www.manaphp.com');
public handle ( string $uri = null, string $host = null, boolean $silent = true ) : boolean
$uri string
$host string
$silent boolean
Результат boolean

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

$group=new \ManaPHP\Mvc\Router\Group(); $group->addGet('/blog','blog::list'); $group->addGet('/blog/{id:\d+}','blog::detail') $router=new \ManaPHP\Mvc\Router(); $router->mount($group,'home');
public mount ( string | ManaPHP\Mvc\Router\GroupInterface $group, string $path = null ) : static
$group string | ManaPHP\Mvc\Router\GroupInterface
$path string
Результат static

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

Set whether router must remove the extra slashes in the handled routes
public removeExtraSlashes ( boolean $remove ) : static
$remove boolean
Результат static

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

Check if the router matches any of the defined routes
public wasMatched ( ) : boolean
Результат boolean