我使用silex和twig;
我创建了自定义的form_div_layout并将其放置在webroot中(例如)
我像这样注册TwigService提供程序
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__ . '/../views',
'twig.options' => array(
'cache' => __DIR__ . '/../cache/twig',
'strict_variables' => false
),
'twig.form.templates'=> [WEBROOT . '/form_div_layout.twig']
));
但是我遇到了一个错误
Twig_Error_Loader: 在“layout.twig”的第52行中未定义模板“/home/versh/sale/web/form_div_layout.twig”。
如何正确注册主题?我知道如果将主题放在twig.path中,它将起作用,但这不是解决方案。