2017-09-14 5 views
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'}] 

そして、これは私がBaseAdminControllerを拡張私のUserControllerである私は

namespace EmployeeBundle\Controller; 

use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController; 
use Symfony\Component\HttpFoundation\Request; 

class UserController extends BaseAdminController 
{ 
    public function listUserAction() 
    { 

    } 
} 
+0

ベンダー/ javiereguiluz/easyadmin-bundle/Controller/AdminController.phpの 'listAction()'を見てください。 – COil

答えて

0

リポジトリからか、コントローラ内のクエリは、私はこれをしなかったし、それが参考になる希望を働いカスタマイズする方法を教えてください他の誰か:

関連する問題