class FrontController implements FrontControllerInterface

The default FrontController

Traits

Patterns\Traits\OptionableTrait
Patterns\Traits\SingletonTrait

Methods

mixed
__call( string $name, array $arguments)

This must allow some shortcuts to access a service

static  mixed
__callStatic( string $name, array $arguments)

This must allow some shortcuts to access a service

__construct( array $options = array())

No description

$this
boot()

No description

bool
isMode( string $mode)

No description

$this
setOptions( array $options)

No description

void
run( RequestInterface $request = null)

No description

handle( RequestInterface $request = null)

No description

mixed
send( ResponseInterface $response = null)

No description

void
addRoute( string $route, callable $callback, string $method = 'get')

No description

string
render( string $view_file, array $params = array(), string $type = 'global')

No description

string
callRoute( string $route, array $arguments = array(), string $method = 'get')

No description

string
callControllerAction( null|string $controller = null, null|string $action = null, array $arguments = array())

No description

void
error( string $message, int $status = 500, int $code, string $filename = __FILE__, int $lineno = __LINE__)

No description

void
redirect( string $url, bool $follow = false)

No description

void
on( string $event, callable $callback)

No description

void
off( string $event, callable $callback)

No description

void
trigger( string $event, mixed $subject = null)

No description

Details

mixed __call( string $name, array $arguments)

This must allow some shortcuts to access a service

Parameters

string $name
array $arguments

Return Value

mixed

static mixed __callStatic( string $name, array $arguments)

This must allow some shortcuts to access a service

Parameters

string $name
array $arguments

Return Value

mixed

at line 105
__construct( array $options = array())

Parameters

array $options

at line 116
$this boot()

Return Value

$this

at line 154
bool isMode( string $mode)

Parameters

string $mode

Return Value

bool

at line 170
$this setOptions( array $options)

Parameters

array $options

Return Value

$this

at line 186
void run( RequestInterface $request = null)

Parameters

RequestInterface $request

Return Value

void

Exceptions

Exception
NotFoundException

at line 198
ResponseInterface handle( RequestInterface $request = null)

Parameters

RequestInterface $request

Return Value

ResponseInterface

at line 221
mixed send( ResponseInterface $response = null)

Parameters

ResponseInterface $response

Return Value

mixed

at line 236
void addRoute( string $route, callable $callback, string $method = 'get')

Parameters

string $route
callable $callback
string $method

Return Value

void

at line 250
string render( string $view_file, array $params = array(), string $type = 'global')

Parameters

string $view_file
array $params
string $type

Return Value

string

at line 265
string callRoute( string $route, array $arguments = array(), string $method = 'get')

Parameters

string $route
array $arguments
string $method

Return Value

string

Exceptions

Exception
InternalServerErrorException
NotFoundException

at line 359
string callControllerAction( null|string $controller = null, null|string $action = null, array $arguments = array())

Parameters

null|string $controller
null|string $action
array $arguments

Return Value

string

Exceptions

InternalServerErrorException

at line 431
void error( string $message, int $status = 500, int $code, string $filename = __FILE__, int $lineno = __LINE__)

Parameters

string $message
int $status
int $code
string $filename
int $lineno

Return Value

void

Exceptions

AccessForbiddenException
ErrorException
InternalServerErrorException
NotFoundException

at line 455
void redirect( string $url, bool $follow = false)

Parameters

string $url
bool $follow

Return Value

void

at line 475
void on( string $event, callable $callback)

Parameters

string $event The event name
callable $callback The event callback

Return Value

void

Exceptions

Exception

at line 493
void off( string $event, callable $callback)

Parameters

string $event The event name
callable $callback The event callback

Return Value

void

Exceptions

Exception

at line 511
void trigger( string $event, mixed $subject = null)

Parameters

string $event
mixed $subject The subject of the event

Return Value

void

Exceptions

Exception