【问题标题】:symfony2 FOSUserBundle base:html.twigsymfony2 FOSUserBundle 基础:html.twig
【发布时间】:2012-11-14 06:25:05
【问题描述】:

我想使用FOSUserBundle,但我没有覆盖我的app/resource/base.html.twig,所以我没有http://knpuniversity.com 教程中的视图。你能告诉我你的base.html.twig whenFOSUserBundle 覆盖了吗?

【问题讨论】:

    标签: symfony fosuserbundle


    【解决方案1】:

    你有你的布局,所以只需在你的 UserBundle/Resources/view 中创建一个 layout.html.twig,然后像这样放在那里

    {% extends 'SomeBundle::layoutyouwanttoverwrite.html.twig' %}
    
    {% block content %}
        {% block fos_user_content %}{% endblock %}
    {% endblock %}
    

    希望对你有帮助:)

    别忘了放

    public function getParent() 
    {
        return 'FOSUserBundle';
    }
    

    在你的 UserBundle 类中:)

    【讨论】:

    • 不,我有这个错误 file_get_contents(C:\wamp\www\facebook\vendor\symfony\symfony\src\Symfony\Bundle\WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig ) [function.file-get-contents]:无法打开流:/facebook/vendor/twig/twig/lib/Twig/Loader/Filesystem.php 第 126 行中没有这样的文件或目录我不明白这个 C:\wamp \www\facebook\vendor\symfony\symfony\src\Symfony\Bundle\WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig 因为我在服务器上发送我的项目
    • hmm,所以这个错误通常显示为其他错误的副作用。你还能看到其他错误吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-29
    • 2012-02-27
    • 2014-06-05
    • 1970-01-01
    • 2013-11-16
    相关资源
    最近更新 更多