我几乎完成了在 Symfony CMF 中安装大部分 Sonata 包。目前。我的最后一步是完成 Sonata PageBundle。我安装了所有需要的依赖项和所需的包,我使用本手册 ( http://sonata-project.org/bundles/page/master/doc/reference/installation.html )从 app/config 更改了几个配置或路由文件。
当我想做“最后”一步时,就会出现问题;
php app/console sonata:easy-extends:generate SonataPageBundle
我收到此错误:
{ParameterNotFoundException:服务“sonata.page.admin.block”依赖于不存在的参数“sonata.block.container.types”。你是说这个:“sonata.page.block.container.class”吗?}
好的,很明显缺少依赖参数,但我无法确定确切的问题。
我的奏鸣曲页面和奏鸣曲块来自 app/config/config.php;
sonata_page:
multisite: host
use_streamed_response: true # set the value to false in debug mode or if the reverse proxy does not handle streamed response
ignore_route_patterns:
- ^(.*)admin(.*) # ignore admin route, ie route containing 'admin'
- ^_(.*) # ignore symfony routes
ignore_routes:
- sonata_page_cache_esi
- sonata_page_cache_ssi
- sonata_page_js_sync_cache
- sonata_page_js_async_cache
- sonata_cache_esi
- sonata_cache_ssi
- sonata_cache_js_async
- sonata_cache_js_sync
- sonata_cache_apc
ignore_uri_patterns:
- ^/admin\/ # ignore admin route, ie route containing 'admin'
page_defaults:
homepage: {decorate: false} # disable decoration for homepage, key - is a page route
default_template: default # template key from templates section, used as default for pages
templates:
default: { path: 'SonataPageBundle::layout.html.twig', name: 'default' }
2columns: { path: 'SonataPageBundle::2columns_layout.html.twig', name: '2 columns layout' }
# manage the http errors
catch_exceptions:
not_found: [404] # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
fatal: [500] # so you can use the same page for different http errors or specify specific page for each error
sonata_block:
# context_manager: sonata.page.block.context_manager
default_contexts: [cms]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
#sonata.admin_doctrine_orm.block.audit:
# contexts: [admin]
sonata.block.service.text:
sonata.block.service.rss:
sonata.page.block.container:
sonata.page.block.children_pages:
在 SO 上有一个类似的问题,但 4 个月没有得到答复,谷歌在这个问题上没有任何信息(我能找到)。
如果有人可以指出出了什么问题以及在哪里,我很想听听。