按照这里,在 AppBundle
中的Controller建立了 CategoryAdmin 类,当运行html
php bin/console server:start
出现code
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
就启动成功了server
最终的效果htm