Overview

Namespaces

  • Autarky
    • Config
      • Loaders
    • Console
    • Container
      • Exception
      • Factory
      • Proxy
    • Database
    • Errors
    • Events
    • Files
    • Http
    • Logging
    • Providers
    • Routing
      • Events
    • Testing
    • TwigTemplating
      • Extensions
    • Utils

Classes

  • Configuration
  • Controller
  • DefaultRouteConfigurator
  • Route
  • RoutePathGenerator
  • Router
  • RoutingProvider
  • UrlGenerator

Interfaces

  • InvokerInterface
  • RoutePathGeneratorInterface
  • RouterInterface

Traits

  • ControllerTrait
  • Overview
  • Namespace
  • Class

Trait ControllerTrait

Trait for controller functionality. Any class that implements this trait should also implement the interface Autarky\Container\ContainerAwareInterface - the interface's methods are implemented by the trait, but you still need to implement the interface on the class.

Autarky\Routing\ControllerTrait uses Autarky\Container\ContainerAwareTrait

Direct Known Users

Autarky\Routing\Controller
Namespace: Autarky\Routing
Located at Routing/ControllerTrait.php
Methods summary
protected string
# render( string $name, array $data = array() )

Render a template.

Render a template.

Parameters

$name
Name of the view.
$data
Data to pass to the view.

Returns

string
protected string
# url( string $name, array $params = array() )

Generate the URL to a route.

Generate the URL to a route.

Parameters

$name
Name of the route.
$params
Route parameters.

Returns

string
protected Symfony\Component\HttpFoundation\Session\Session
# getSession( )

Get the session manager.

Get the session manager.

Returns

Symfony\Component\HttpFoundation\Session\Session
protected
# flash( string $key, mixed $value )

Flash something to the session.

Flash something to the session.

Parameters

$key
$value
protected
# flashMessages( array $messages )

Flash an array of messages to the session.

Flash an array of messages to the session.

Parameters

$messages
protected
# flashInput( Symfony\Component\HttpFoundation\Request $request = null )

Flash input to session.

Flash input to session.

Parameters

$request
Optional
protected array
# getOldInput( )

Get old input flashed to the session.

Get old input flashed to the session.

Returns

array
protected Symfony\Component\EventDispatcher\EventDispatcherInterface
# getEventDispatcher( )

Get the event dispatcher instance.

Get the event dispatcher instance.

Returns

Symfony\Component\EventDispatcher\EventDispatcherInterface
protected mixed
# dispatchEvent( string $name, Symfony\Component\EventDispatcher\Event $event )

Dispatch an event.

Dispatch an event.

Parameters

$name
$event

Returns

mixed
protected
# log( string $level, string $message, array $context = array() )

Log a message.

Log a message.

Parameters

$level
https://github.com/php-fig/log/blob/master/Psr/Log/LogLevel.php
$message
$context
protected Psr\Log\LoggerInterface
# getLogger( )

Get the logger instance.

Get the logger instance.

Returns

Psr\Log\LoggerInterface
protected Symfony\Component\HttpFoundation\Response
# response( string $content, integer $statusCode = 200 )

Create a response.

Create a response.

Parameters

$content
$statusCode

Returns

Symfony\Component\HttpFoundation\Response
protected Symfony\Component\HttpFoundation\RedirectResponse
# redirect( string $name, array $params = array(), integer $statusCode = 302 )

Create a redirect response.

Create a redirect response.

Parameters

$name
Name of the route to redirect to
$params
Route parameters
$statusCode
Default: 302

Returns

Symfony\Component\HttpFoundation\RedirectResponse
protected Symfony\Component\HttpFoundation\JsonResponse
# json( array $data, integer $statusCode = 200 )

Create a JSON response.

Create a JSON response.

Parameters

$data
$statusCode

Returns

Symfony\Component\HttpFoundation\JsonResponse
Methods used from Autarky\Container\ContainerAwareTrait
setContainer()
Properties used from Autarky\Container\ContainerAwareTrait
$container
Autarky Framework API documentation generated by ApiGen