我有一个使用Symfony3的项目,我想添加easyAdminBundle来处理我的后端,但是我的配置有问题。 我无法访问我的后端并收到此错误
注意:未定义的索引:视图
if ($this->request->attributes->has('easyadmin')) {
$easyadmin = $this->request->attributes->get('easyadmin');
$entity = $easyadmin['entity'];
$action = $easyadmin['views'];
$fields = isset($entity[$action]['fields']) ? $entity[$action]['fields'] : array();
$view->vars['easyadmin'] = array(
'entity' => $entity,
我的AdminController.php
namespace FaimfonyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
class AdminController extends BaseAdminController
{
public function createNewUserEntity()
{
return $this->get('fos_user.user_manager')->createUser();
}
public function prePersistUserEntity($user)
{
$this->get('fos_user.user_manager')->updateUser($user, false);
}
}
我的config.yml
easy_admin:
entities:
- FaimfonyBundle\Entity\Restaurant