Ubiquity  2.0.0
php rapid development framework
Router Class Reference

Router. More...

Static Public Member Functions

static slashPath ($path)
 
static start ()
 
static startRest ()
 
static getRoute ($path, $cachedResponse=true)
 
static getRouteInfoByControllerAction ($controller, $action)
 
static filterRoutes ($path)
 
static getRouteInfo ($path)
 
static getAnnotations ($controllerName, $actionName)
 
static getRouteByName ($name, $parameters=[], $absolute=true)
 Returns the generated path from a route. More...
 
static path ($name, $parameters=[], $absolute=false)
 Returns the generated path from a route. More...
 
static url ($name, $parameters=[])
 Returns the generated url from a route. More...
 
static getRouteUrlParts ($routeArray, $params, $cached=false, $duration=NULL, $cachedResponse=true)
 
static setExpired ($routePath, $expired=true)
 Déclare une route comme étant expirée ou non. More...
 
static addRoute ($path, $controller, $action="index", $methods=null, $name="", $cache=false, $duration=null, $requirements=[])
 
static addRouteToRoutes (&$routesArray, $path, $controller, $action="index", $methods=null, $name="", $cache=false, $duration=null, $requirements=[])
 

Static Protected Member Functions

static _getURL ($routePath, $params)
 
static checkRouteName ($routeDetails, $name)
 

Static Private Member Functions

static cleanParam ($param)
 

Static Private Attributes

static $routes
 

Detailed Description

Router.

Author
jc
Version
1.0.0.2

Definition at line 15 of file Router.php.

Member Function Documentation

◆ _getURL()

static _getURL (   $routePath,
  $params 
)
staticprotected

Definition at line 139 of file Router.php.

◆ addRoute()

static addRoute (   $path,
  $controller,
  $action = "index",
  $methods = null,
  $name = "",
  $cache = false,
  $duration = null,
  $requirements = [] 
)
static
Parameters
string$path
string$controller
string$action
array | null$methods
string$name
boolean$cache
int$duration
array$requirements

Definition at line 214 of file Router.php.

◆ addRouteToRoutes()

static addRouteToRoutes ( $routesArray,
  $path,
  $controller,
  $action = "index",
  $methods = null,
  $name = "",
  $cache = false,
  $duration = null,
  $requirements = [] 
)
static

Definition at line 218 of file Router.php.

◆ checkRouteName()

static checkRouteName (   $routeDetails,
  $name 
)
staticprotected

Definition at line 149 of file Router.php.

◆ cleanParam()

static cleanParam (   $param)
staticprivate

Definition at line 188 of file Router.php.

◆ filterRoutes()

static filterRoutes (   $path)
static

Definition at line 62 of file Router.php.

◆ getAnnotations()

static getAnnotations (   $controllerName,
  $actionName 
)
static

Definition at line 86 of file Router.php.

◆ getRoute()

static getRoute (   $path,
  $cachedResponse = true 
)
static

Definition at line 34 of file Router.php.

◆ getRouteByName()

static getRouteByName (   $name,
  $parameters = [],
  $absolute = true 
)
static

Returns the generated path from a route.

Parameters
string$namename of the route
array$parametersarray of the route parameters. default : []
boolean$absolute

Definition at line 104 of file Router.php.

◆ getRouteInfo()

static getRouteInfo (   $path)
static

Definition at line 73 of file Router.php.

◆ getRouteInfoByControllerAction()

static getRouteInfoByControllerAction (   $controller,
  $action 
)
static

Definition at line 49 of file Router.php.

◆ getRouteUrlParts()

static getRouteUrlParts (   $routeArray,
  $params,
  $cached = false,
  $duration = NULL,
  $cachedResponse = true 
)
static

Definition at line 159 of file Router.php.

◆ path()

static path (   $name,
  $parameters = [],
  $absolute = false 
)
static

Returns the generated path from a route.

Parameters
string$namethe route name
array$parametersdefault: []
boolean$absolutetrue if the path is absolute (/ at first)
Returns
boolean|string|array|mixed the generated path (/path/to/route)

Definition at line 125 of file Router.php.

◆ setExpired()

static setExpired (   $routePath,
  $expired = true 
)
static

Déclare une route comme étant expirée ou non.

Parameters
string$routePath
boolean$expired

Definition at line 199 of file Router.php.

◆ slashPath()

static slashPath (   $path)
static

Definition at line 18 of file Router.php.

◆ start()

static start ( )
static

Definition at line 26 of file Router.php.

◆ startRest()

static startRest ( )
static

Definition at line 30 of file Router.php.

◆ url()

static url (   $name,
  $parameters = [] 
)
static

Returns the generated url from a route.

Parameters
string$namethe route name
array$parametersdefault: []
Returns
string the generated url (http://myApp/path/to/route)

Definition at line 135 of file Router.php.

Field Documentation

◆ $routes

$routes
staticprivate

Definition at line 16 of file Router.php.


The documentation for this class was generated from the following file: