生成捆绑包时,TitleCase 名称是否有效?例如,Acme\TitleCaseBundle
Symfony2 会自动假设路由的前缀是acme_title_case
,服务是acme_title_case.example:
和 in Acme\TitleCaseBundle\DependencyInjection\Configuration
,配置树的根节点是用这个方法找到的
<?php
// ...
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('acme_title_case');
// ...
}
它应该是acme_titlecase
!
尝试更正这些,然后添加acme_titlecase: ~
到app/config/config.yml
将引发此错误
InvalidArgumentException: There is no extension able to load the configuration for
"acme_titlecase" (in /Users/me/Sites/MySite/app/config/config.yml).
Looked for namespace "acme_titlecase",
found "framework", "another_namespace", ... , "acme_title_case", ...