Using custom functions with Timber
问题 I've been trying to get a custom function working by using the example in the Timber starter theme, and following the instructions in the Timber docs, but I can't for the life of me get this working. My functions.php is like so: class StarterSite extends TimberSite { ... function my_function() { return "Foo"; } function add_to_twig( $twig ) { /* this is where you can add your own functions to twig */ $twig->addExtension( new Twig_Extension_StringLoader() ); $twig->addFilter('my_function', new