PHP Class Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener

Author: Fabien Potencier ([email protected])
ファイルを表示 Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$container Symfony\Component\DependencyInjection\ContainerInterface

Public Methods

Method Description
__construct ( Symfony\Component\DependencyInjection\ContainerInterface $container ) Constructor.
onKernelController ( FilterControllerEvent $event ) Guesses the template name to render and its variables and adds them to the request object.
onKernelView ( GetResponseForControllerResultEvent $event ) Renders the template and initializes a new response object with the rendered template content.

Protected Methods

Method Description
getBundleForClass ( string $class ) Returns the Bundle instance in which the given class name is located.
guessTemplateName ( array $controller, Request $request ) : TemplateReference Guesses and returns the template name to render based on the controller and action names.

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\DependencyInjection\ContainerInterface $container )
$container Symfony\Component\DependencyInjection\ContainerInterface The service container instance

getBundleForClass() protected method

Returns the Bundle instance in which the given class name is located.
protected getBundleForClass ( string $class )
$class string A fully qualified controller class name

guessTemplateName() protected method

Guesses and returns the template name to render based on the controller and action names.
protected guessTemplateName ( array $controller, Request $request ) : TemplateReference
$controller array An array storing the controller object and action method
$request Symfony\Component\HttpFoundation\Request A Request instance
return Symfony\Bundle\FrameworkBundle\Templating\TemplateReference template reference

onKernelController() public method

Guesses the template name to render and its variables and adds them to the request object.
public onKernelController ( FilterControllerEvent $event )
$event Symfony\Component\HttpKernel\Event\FilterControllerEvent A FilterControllerEvent instance

onKernelView() public method

Renders the template and initializes a new response object with the rendered template content.
public onKernelView ( GetResponseForControllerResultEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent A GetResponseForControllerResultEvent instance

Property Details

$container protected_oe property

protected ContainerInterface,Symfony\Component\DependencyInjection $container
return Symfony\Component\DependencyInjection\ContainerInterface