symfony - mopabootstrap bundle 和 symfony2 问题

标签 symfony twitter-bootstrap

我正在使用这个mopabootstrap bundle ,遵循所有说明。我收到以下错误:

An exception has been thrown during the compilation of a template ("Unable to find file "@MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-transition.js".") in "MopaBootstrapBundle::base.html.twig".

我在这里找到了似乎对我的 issue 有答案的帖子以及,但我尝试过,它仍然给我同样的错误。我该如何解决这个问题?

最佳答案

如果您使用最新版本的 MopaBootstrap 和 Symfony 2.1 或 2.2,则 twitter/bootstrap 文件似乎未正确安装和符号链接(symbolic link)。

也许您错过了 composer.json 部分:

{
    "scripts": {
        "post-install-cmd": [
            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ],
        "post-update-cmd": [
            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ]
    }
}

from the MopaBootstrap doc

这些命令从供应商文件夹创建符号链接(symbolic link):/vendor/twitter/bootstrap 到 MopaBootstrap 文件夹:

/vendor/mopa/bootstrap-bundle/Mopa/BootstrapBundle/Resources/bootstrap

请务必在您的composer.json 中安装 twitter/bootstrap:

{
    "require": {
        "mopa/bootstrap-bundle": "dev-master",
        "twitter/bootstrap": "dev-master"
    }
}

关于symfony - mopabootstrap bundle 和 symfony2 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12257898/

相关文章:

php - 从 Symfony 2 测试用例运行控制台命令

php - 在 Symfony kernel.controller 事件中,ControllerEvent::getController() 的返回类型是什么?

javascript - 按钮单击不以弹出窗口形式触发

html - 文字稍微偏离中心

html - Bootstrap Navbar 右对齐不起作用

html - 如何更改 Bootstrap 弹出窗口的宽度

php - 使用 VichGeographicalBundle 在 Symfony2 中单击时不显示 Google map 信息窗口

symfony - 将一对多连接结果作为对象中的数组返回

javascript - 在 bootstrap 网格中将 div 包裹在大 div 周围

symfony - 动态删除 JMS 序列化程序事件订阅者内的实体