【发布时间】:2013-04-11 22:24:18
【问题描述】:
我的 FOSCommentBundle 有问题。我已经设置了我的捆绑包,它工作了几天,但今天它不工作了。我很头疼,无法找到解决方案。
问题是 fos_comment_script.src = '/web/js/35a8e64_cmets_1.js' 不存在,我无法访问它,所以没有添加线程,也没有显示任何内容。 我没有收到任何错误,什么都没有,一切看起来都很好,但什么也没发生。 我正在使用 async.twig.html 并且在我的页面上生成的 javascript 看起来像这样
// thread id
var fos_comment_thread_id = '309';
// api base url to use for initial requests
var fos_comment_thread_api_base_url = '/web/api/threads';
// Snippet for asynchronously loading the comments
(function() {
var fos_comment_script = document.createElement('script');
fos_comment_script.async = true;
fos_comment_script.src = '/web/js/35a8e64_comments_1.js';
fos_comment_script.type = 'text/javascript';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fos_comment_script);
})();
谢谢你提前很多。
【问题讨论】:
-
你能手动找到文件还是不存在?
-
该文件在 vendor/path/to/comment.js 下,但 '/web/js/35a8e64_cmets_1.js' 不存在。
-
你可能在缓存被清除后忘记运行
php ./app/console assetic:dump --env=dev。请查看the symfony cookbook的asset_management部分了解更多信息 -
谢谢你成功了。我为此浪费了几个小时:(,如此简单的解决方案。感谢您对过去的帮助有很大的不同,我的生命充满喜悦:)。
-
你能接受答案吗:)很高兴我能帮助你!
标签: symfony bundle foscommentbundle