route

A route object is created every time you call iPinga->addRoute() method. You can work with routes directly, although I personally see not much point to doing so.

Parent Class

None


Public Properties

$fired
Will be set to TRUE if this is the route that was fired during the ipinga->run()
Data Type: boolean
Default Value: false
$urlToMatch
See’s iPinga->addRoute()’s first parameter
Data Type: string
Default Value: Empty string
$controller
See’s iPinga->addRoute()’s second parameter
Data Type: string
Default Value: Empty string
$method
See’s iPinga->addRoute()’s third parameter
Data Type: string
Default Value: Empty string
$middleware
See’s iPinga->addRoute()’s fourth parameter
Data Type: string
Default Value: Empty string

Static Methods

void launchController( string $controller, string $method, array $params)
Used primarily as an internal way of launching a controller/method. There are times when it’s useful to be able to call this directly so I have exposed it as a static method.
Parameters:
$controller (string) the controller’s name
$method (string) the method’s name within that controller
$params (array) a list of parameters to pass to the method
Returns:
null

Public Methods

\ipinga\route __construct( string $urlToMatch, string $controller, string $method [, string $middleware] )
This is the class constructor.
Parameters:
see above
Returns:
A route instance
boolean handled(string $route)
See if the requested URL route can be handled by this route. handled first verifies that all associated middleware if any, all return true prior to handling this URL route.
Parameters:
$route is the url to test to see if this route should respond
Returns:
True if this route handled the response, otherwise false. If false, the next route is attempted and so on