public function add_to_twig( $twig ) {
		$twig->addExtension( new Twig_Extension_StringLoader() );
		$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
		return $twig;
	}
public function add_to_twig( $twig ) {
		$twig->addExtension( new Twig_Extension_StringLoader() );
		$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
		return $twig;
	}
public function add_to_twig ( $ twig ) { $ twig -> addExtension ( new Twig_Extension_StringLoader ( ) ) ; $ twig -> addFilter ( new Twig_SimpleFilter ( 'myfoo' , array ( $ this , 'myfoo' ) ) ) ; return $ twig ; }
This is where you can add your own functions to twig.

@param string $twig get extension.
This is where you can add your own functions to twig .