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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -