PHP Interface ManaPHP\Mvc\RouterInterface

Datei anzeigen Open project: manaphp/manaphp

Public Methods

Method 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 method

Returns processed action name
public getActionName ( ) : string
return string

getControllerName() public method

Returns processed controller name
public getControllerName ( ) : string
return string

getModuleName() public method

Returns processed module name
public getModuleName ( ) : string
return string

getModules() public method

public getModules ( ) : array
return array

getParams() public method

Returns processed extra params
public getParams ( ) : array
return array

getRewriteUri() public method

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

handle() public method

$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
return boolean

mount() public method

$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
return static

removeExtraSlashes() public method

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

wasMatched() public method

Check if the router matches any of the defined routes
public wasMatched ( ) : boolean
return boolean