PHP Class Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener

Author: Fabien Potencier ([email protected])
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Свойство Type Description
$container Symfony\Component\DependencyInjection\ContainerInterface

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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

getBundleForClass() protected méthode

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 méthode

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
Résultat Symfony\Bundle\FrameworkBundle\Templating\TemplateReference template reference

onKernelController() public méthode

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 méthode

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
Résultat Symfony\Component\DependencyInjection\ContainerInterface