PHP Interface ManaPHP\Mvc\RouterInterface

Afficher le fichier Open project: manaphp/manaphp

Méthodes publiques

Méthode Description
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

Method Details

getActionName() public méthode

Returns processed action name
public getActionName ( ) : string
Résultat string

getControllerName() public méthode

Returns processed controller name
public getControllerName ( ) : string
Résultat string

getModuleName() public méthode

Returns processed module name
public getModuleName ( ) : string
Résultat string

getModules() public méthode

public getModules ( ) : array
Résultat array

getParams() public méthode

Returns processed extra params
public getParams ( ) : array
Résultat array

getRewriteUri() public méthode

Get rewrite info. This info is read from $_GET['_url'] or _SERVER["REQUEST_URI"].
public getRewriteUri ( ) : string
Résultat string

handle() public méthode

$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
Résultat boolean

mount() public méthode

$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
Résultat static

removeExtraSlashes() public méthode

Set whether router must remove the extra slashes in the handled routes
public removeExtraSlashes ( boolean $remove ) : static
$remove boolean
Résultat static

wasMatched() public méthode

Check if the router matches any of the defined routes
public wasMatched ( ) : boolean
Résultat boolean