Silex - Twig_Error_Syntax: The function “path” does not exist
问题 According to the Silex documentation: Symfony provides a Twig bridge that provides additional integration between some Symfony2 components and Twig. Add it as a dependency to your composer.json file. I include the following in my composer.json file: { "require": { "silex/silex": "1.*", "twig/twig": ">=1.8,<2.0-dev", "symfony/twig-bridge": "2.3.*" } } I register the TwigServiceProvider() like so: $app->register(new Silex\Provider\TwigServiceProvider(), array( 'twig.path' => __DIR__ . '/views'