Skip to the content
Documentation

Parameters injection in content views

No ratings yet

It is possible to dynamically inject variables in content view templates by listening to the exponential.pre_content_view event.

The event listener method receives an eZ\Publish\Core\MVC\Symfony\Event\PreContentViewEvent object

Example

The following example will inject foo and osTypes variables in all content view templates.

Service configuration

 

 

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.