symfony - filters in twig call -


how call function function filter filter? eg

public function getfilters()      {           return array (              'test' => new \ twig_filter_method ($this, 'test'),              'test1' => new \ twig_filter_method ($this, 'test1', array('is_safe' => array('html')))          );      }   public function test($test) {     return; }   public function test1($test) {     // how test call? } 

thanks , sorry english

from twig template can this:

{{ 'some string'|test|test1('argument')}} 

inside twig extension class can call test function regular php object function:

public function test1($test) {     // code     $testresult = $this->test($test); } 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -