I have a use-case for adding a ucfirst
filter in my twig template and I have it working just fine by using this:
$this->getServiceLocator()
->get('Twig_Environment')
->addFilter(
new \Twig_SimpleFilter(
'ucfirst',
'ucfirst'
)
);
However I am curious if it's possible to add this filter via the module.config.php
?
Perhaps something like this:
'zfctwig' => [
'environment_options' => [
'cache' => 'data/cache/twig',
'debug' => true
],
'extensions' => [
'Twig_Extension_Debug'
],
'Twig_Environment' => [
'filters' => [
'ucfirst' => 'ucfirst'
]
]
]
I know this snippet is wrong, but if it is possible, what would the configuration look like?
I'm currently using ZF2 with the ZfcTwig module.