Symfony 获取 twig 模板的文件路径,该文件在 customBundle:Resources:views 中而不是在 web 目录中
Symfony Get a file path into a twig template, the file is in customBundle:Resources:views not in web dir
在我的一个树枝模板中,我有一个 javascript 块
我必须在其中给出某个 html 文件的路径。
我试过这个但是有控制台错误
jQuery(document).ready(function ($) {
$("#content").builder({
themeFile: '{{ "ContentbuildBundle:Template:theme.html.twig" }}',
toolbar: 'right',
onRender: function() {
$('#contentarea').trigger('focusout');
}
});
}
enter image description here
在我的一个树枝模板中,我有一个 javascript 块
我必须在其中给出某个 html 文件的路径。
我试过这个但是有控制台错误
jQuery(document).ready(function ($) {
$("#content").builder({
themeFile: '{{ "ContentbuildBundle:Template:theme.html.twig" }}',
toolbar: 'right',
onRender: function() {
$('#contentarea').trigger('focusout');
}
});
}
enter image description here