EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
4.07k stars 1.02k forks source link

Can't override AdminController in Symfony4 by setting resource path using AppBundle, had to use full path to resource instead #1993

Closed tomde closed 6 years ago

tomde commented 6 years ago

Hello,

I tried to override AdminController in new Symfony4 setup. I followed documentation and setup the path to new resource to the routers/easy_admin.yml like this:

easy_admin_bundle:
resource: '@AppBundle/Controller/AdminController.php'
prefix: /admin
type: annotation

it doesn't work, so i tried to change the route according to the new symfony routing like this:

easy_admin_bundle:
resource: '@App/Controller/AdminController.php'
prefix: /admin
type: annotation

but this does not work either. So i ended using full relative path to the resource:

easy_admin_bundle:
resource: '../../src/Controller/AdminController.php'
prefix: /admin
type: annotation

Could you please explain what is the right way to call a resource and add it also to documentation?

Thanks.

used version of easyadminbundle: v1.17.7

uncle-scrooge commented 6 years ago

Hello tomde,

Looking at the demo, it seems that your third solution is the right way.

https://github.com/javiereguiluz/easy-admin-demo/blob/master/config/routes.yaml

tomde commented 6 years ago

Thanks uncle-scrooge,

i think documentation is little bit outdated and should be updated.

DamianRosiak commented 6 years ago

i have it like this

easy_admin_bundle:
    resource: 'App\Controller\BaseController'
    prefix: /admin
    type: annotation
uncle-scrooge commented 6 years ago

Hello @Czacha

Thank you for your sharing.

@tomde please can you try Czacha solution ?

javiereguiluz commented 6 years ago

@tomde @uncle-scrooge I'm trying to fix this in #2040. Could you please review it? Thanks!