[sonata admin] argument "$code" of method
按照这里,在 AppBundle
中的Controller创建了 CategoryAdmin 类,当运行
php bin/console server:start
出现
Cannot autowire service "AppBundle\Controller\CategoryAdmin": argument "$code" of method "Sonata\AdminBundle\Admin\AbstractAdmin::__construct()" has no
type-hint, you should configure its value explicitly.
通过搜索资料,找到 Empty Dashboard Symfony3 sonata adminBundle 最后比对才发现,需要把 src/AppBundle/Controller/CategoryAdmin.php
放入到 src/AppBundle/Admin/CategoryAdmin.php
,
然后再运行 php bin/console server:start
就启动成功了
最终的效果