我正在使用这个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"
]
}
}
这些命令从供应商文件夹创建符号链接(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/