PHP Trait Autarky\Routing\ControllerTrait

Inheritance: use trait Autarky\Container\ContainerAwareTrait
Datei anzeigen Open project: autarky/framework

Protected Methods

Method Description
dispatchEvent ( string $name, Symfony\Component\EventDispatcher\Event $event ) : mixed Dispatch an event.
flash ( string $key, mixed $value ) : void Flash something to the session.
flashInput ( Request $request = null ) : void Flash input to session.
flashMessages ( array $messages ) : void Flash an array of messages to the session.
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface Get the event dispatcher instance.
getLogger ( ) : Psr\Log\LoggerInterface Get the logger instance.
getOldInput ( ) : array Get old input flashed to the session.
getSession ( ) : Symfony\Component\HttpFoundation\Session\Session Get the session manager.
json ( array $data, integer $statusCode = 200 ) : Symfony\Component\HttpFoundation\JsonResponse Create a JSON response.
log ( string $level, string $message, array $context = [] ) : void Log a message.
redirect ( string $name, array $params = [], integer $statusCode = 302 ) : RedirectResponse Create a redirect response.
render ( string $name, array $data = [] ) : string Render a template.
response ( string $content, integer $statusCode = 200 ) : Response Create a response.
url ( string $name, array $params = [] ) : string Generate the URL to a route.

Method Details

dispatchEvent() protected method

Dispatch an event.
protected dispatchEvent ( string $name, Symfony\Component\EventDispatcher\Event $event ) : mixed
$name string
$event Symfony\Component\EventDispatcher\Event
return mixed

flash() protected method

Flash something to the session.
protected flash ( string $key, mixed $value ) : void
$key string
$value mixed
return void

flashInput() protected method

Flash input to session.
protected flashInput ( Request $request = null ) : void
$request Symfony\Component\HttpFoundation\Request Optional
return void

flashMessages() protected method

Flash an array of messages to the session.
protected flashMessages ( array $messages ) : void
$messages array
return void

getEventDispatcher() protected method

Get the event dispatcher instance.
protected getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
return Symfony\Component\EventDispatcher\EventDispatcherInterface

getLogger() protected method

Get the logger instance.
protected getLogger ( ) : Psr\Log\LoggerInterface
return Psr\Log\LoggerInterface

getOldInput() protected method

Get old input flashed to the session.
protected getOldInput ( ) : array
return array

getSession() protected method

Get the session manager.
protected getSession ( ) : Symfony\Component\HttpFoundation\Session\Session
return Symfony\Component\HttpFoundation\Session\Session

json() protected method

Create a JSON response.
protected json ( array $data, integer $statusCode = 200 ) : Symfony\Component\HttpFoundation\JsonResponse
$data array
$statusCode integer
return Symfony\Component\HttpFoundation\JsonResponse

log() protected method

Log a message.
protected log ( string $level, string $message, array $context = [] ) : void
$level string https://github.com/php-fig/log/blob/master/Psr/Log/LogLevel.php
$message string
$context array
return void

redirect() protected method

Create a redirect response.
protected redirect ( string $name, array $params = [], integer $statusCode = 302 ) : RedirectResponse
$name string Name of the route to redirect to
$params array Route parameters
$statusCode integer Default: 302
return Symfony\Component\HttpFoundation\RedirectResponse

render() protected method

Render a template.
protected render ( string $name, array $data = [] ) : string
$name string Name of the view.
$data array Data to pass to the view.
return string

response() protected method

Create a response.
protected response ( string $content, integer $statusCode = 200 ) : Response
$content string
$statusCode integer
return Symfony\Component\HttpFoundation\Response

url() protected method

Generate the URL to a route.
protected url ( string $name, array $params = [] ) : string
$name string Name of the route.
$params array Route parameters.
return string