0
我想知道如何覆蓋EasyAdminBundle控制器。實際上,我想從數據庫中編寫一些自定義查詢,我不想使用dqlFilter。我如何覆蓋easyAdminBundle控制器
以下是我的config.yml文件。
easy_admin:
site_name: 'site mame .'
entities:
User:
class: EmployeeBundle\Entity\EmployeeLogin
controller: EmployeeBundle\Controller\UserController
form:
fields: ['id', {property : 'userName', label : 'Users'}, {property: 'status', type:'choice', type_options: {choices: {'Active':'1', 'Deactive':'0'}}}]
new:
title: 'Add Login'
form_options: { validation_groups: ['Default', 'EmployeeLogin'] }
fields: ['-id']
edit:
title: 'Edit Login Details'
form_options: { validation_groups: ['Default'] }
label: 'Employees'
list:
title: "%%entity_label%% customers"
help: 'The list view overrides the global help message'
fields: ['id', {property : 'userName', label : 'Users'}, {property: 'status', type: 'boolean'}, {property : 'lastLogin',format: 'D j-n-Y, h:i:s'}]
這是我UserController中,我延長BaseAdminController請讓我知道我可以自定義查詢從倉庫或控制器內
namespace EmployeeBundle\Controller;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
use Symfony\Component\HttpFoundation\Request;
class UserController extends BaseAdminController
{
public function listUserAction()
{
}
}
查看vendor/javiereguiluz/easyadmin-bundle/Controller/AdminController.php中的listAction() – COil