class Controller

A wrapper for a controller, mapped to a route.

__call() forwards method-calls to Route, but returns instance of Controller listing Route's methods below, so that IDEs know they are valid

Methods

__construct(Route $route)

Constructor.

getRoute()

Gets the controller's route.

string
getRouteName()

Gets the controller's route name.

bind(string $routeName)

Sets the controller's route.

__call($method, $arguments)

No description

freeze()

Freezes the controller.

generateRouteName($prefix)

No description

Controller
assert(string $variable, string $regexp)

No description

Controller
value(string $variable, mixed $default)

No description

Controller
convert(string $variable, mixed $callback)

No description

Controller
method(string $method)

No description

Controller
requireHttp()

No description

Controller
requireHttps()

No description

Controller
before(mixed $callback)

No description

Controller
after(mixed $callback)

No description

Controller
when(string $condition)

No description

Details

at line 45
__construct(Route $route)

Constructor.

Parameters

Route $route

at line 55
Route getRoute()

Gets the controller's route.

Return Value

Route

at line 65
string getRouteName()

Gets the controller's route name.

Return Value

string

at line 77
Controller bind(string $routeName)

Sets the controller's route.

Parameters

string $routeName

Return Value

Controller $this The current Controller instance

at line 88
__call($method, $arguments)

Parameters

$method
$arguments

at line 104
freeze()

Freezes the controller.

Once the controller is frozen, you can no longer change the route name

at line 109
generateRouteName($prefix)

Parameters

$prefix

at line 34
Controller assert(string $variable, string $regexp)

Parameters

string $variable
string $regexp

Return Value

Controller

at line 34
Controller value(string $variable, mixed $default)

Parameters

string $variable
mixed $default

Return Value

Controller

at line 34
Controller convert(string $variable, mixed $callback)

Parameters

string $variable
mixed $callback

Return Value

Controller

at line 34
Controller method(string $method)

Parameters

string $method

Return Value

Controller

at line 34
Controller requireHttp()

Return Value

Controller

at line 34
Controller requireHttps()

Return Value

Controller

at line 34
Controller before(mixed $callback)

Parameters

mixed $callback

Return Value

Controller

at line 34
Controller after(mixed $callback)

Parameters

mixed $callback

Return Value

Controller

at line 34
Controller when(string $condition)

Parameters

string $condition

Return Value

Controller