interface FrontControllerInterface implements SingletonInterface, OptionableInterface, ServiceContainerProviderInterface

Interface FrontControllerInterface

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

bool
isMode( string $mode)

No description

void
run( RequestInterface $request = null)

This must boot the system, handle the request, send resulting response and terminate the system

handle( RequestInterface $request = null)

No description

mixed
send( ResponseInterface $response = null)

No description

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

No description

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

No description

string
render( string $view_file, array $params = array())

No description

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

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
on( string $event, callable $callback)

Registers a new event listener

void
off( string $event, callable $callback)

Unregisters a new event listener

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

Tiggers an event

Details

mixed __call( string $name, array $arguments)

This must allow some shortcuts to access a service

Usage:

 $obj->get('request') == $obj->getService('request')
 $obj->getRequest() == $obj->getService('request')

Parameters

string $name
array $arguments

Return Value

mixed

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

This must allow some shortcuts to access a service

Usage:

 $obj::get('request') == $obj::getInstance()->getService('request')
 $obj::getRequest() == $obj::getInstance()->getService('request')

Parameters

string $name
array $arguments

Return Value

mixed

at line 39
bool isMode( string $mode)

Parameters

string $mode

Return Value

bool

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

This must boot the system, handle the request, send resulting response and terminate the system

Parameters

RequestInterface $request

Return Value

void

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

Parameters

RequestInterface $request

Return Value

ResponseInterface

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

Parameters

ResponseInterface $response

Return Value

mixed

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

Parameters

string $url
bool $follow

Return Value

void

at line 76
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

at line 83
string render( string $view_file, array $params = array())

Parameters

string $view_file
array $params

Return Value

string

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

Parameters

string $route
callable $callback
string $method

Return Value

void

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

Parameters

string $route
array $arguments
string $method

Return Value

string

at line 107
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

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

Registers a new event listener

Parameters

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

Return Value

void

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

Unregisters a new event listener

Parameters

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

Return Value

void

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

Tiggers an event

Parameters

string $event
mixed $subject The subject of the event

Return Value

void