duangu1868
2014-04-09 09:06
浏览 32
已采纳

将Bundle注册到symfony内核

Instead of Using composer I download zip file of a bundle and extract this bundle to my symfony project. I change all relative address for example I change all "namespace Trsteel\CkeditorBundle;" to "namespace Acme\TrsteelCkeditorBundle;" for doing this I searched the downloaded directory for every "Trsteel\CkeditorBundle" and change all of them to Acme\TrsteelCkeditorBundle now when I want to use this Bundle on my project I register this bundle to my appKernel.php of symfony project But I reached this error

Error: Class 'Acme\TrsteelCkeditorBundle\TrsteelCkeditorBundle' not found in /Users/kingkong/Documents/workspace/dev/Project/SRC/app/AppKernel.php line 45

图片转代码服务由CSDN问答提供 功能建议

我没有使用作曲家而是下载了一个包的zip文件并将这个包提取到我的symfony项目中。 我更改了所有相对地址,例如我更改了所有“namespace Trsteel \ CkeditorBundle;” 到“命名空间Acme \ TrsteelCkeditorBundle;” 为了做到这一点,我搜索下载的目录中的每个“Trsteel \ CkeditorBundle”并将所有这些更改为Acme \ TrsteelCkeditorBundle,当我想在我的项目中使用此Bundle时我将这个包注册到我的symfony项目的appKernel.php但我达到了 此错误

错误:在/Users/kingkong/Documents/workspace/dev/Project/SRC/app/AppKernel.php第45行中找不到类'Acme \ TrsteelCkeditorBundle \ TrsteelCkeditorBundle'

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • douchun1961 2014-04-09 19:42
    已采纳

    File names should be the same as namespace structure, capitalization may be an issue, so check that.

    You may want to place the bundle in this way - "Acme\Trsteel\CkeditorBundle\CkeditorBundle"

    点赞 评论
  • duanji5746 2014-04-09 09:12

    Check whether you have actually changed the folder structure from Trsteel\CkeditorBundle to Acme\TrsteelCkeditorBundle. And also check your routing files as well. (I assume you have done the routing part as the error won't say that it can't get to that location.)

    Cheers!

    点赞 评论

相关推荐 更多相似问题