[英]SonataAdmin in Symfony3 - There are no model managers registered
我想使用命令 Sonata:admin:generate 從實體生成管理員,但每次都會出現以下錯誤:
[RuntimeException] There are no model managers registered.
任何想法為什么會這樣?
我會猜一猜,但是您是否按照此處的描述安裝了 SonataDoctrineORMAdminBundle?
我有類似的問題。 當我嘗試生成管理類時,出現錯誤:
In AdminMaker.php line 295:
沒有注冊模特經理。
但是,我已經在 bundles.php 中安裝並激活了 bundles SonataDoctrineORMAdminBundle
Sonata\DatagridBundle\SonataDatagridBundle::class => ['all' => true],
Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true],
怎么了? 這個“模特經理”是什么? 也安裝和配置了 Doctrine 包...
doctrine:
dbal:
# configure these for your database server
# use postgresql for PostgreSQL
# use sqlite for SQLite
driver: 'mysql'
server_version: '5.7'
# only needed for MySQL
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.