Easyadmin 1.15.3, Symfony 2.8.7.
Any changes done to config.yml result on EasyAdmin's routing to become unavailable, on the dev environment.
routing.yml :
easy_admin_bundle:
resource: "@AppBundle/Controller/Admin/AdminController.php"
type: annotation
prefix: /backend
I added custom action to my entity i overrided Adon controller :
Config.yml:
Utilisateurs :
class: WebBundle\Entity\Utilisateurs
list:
actions:
- new
- edit
- { name: 'affectation', label : 'Affectation' }
BackendBundle/Admin/AdminController.php :
<?php
namespace BackendBundle\Controller\Admin;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
class AdminController extends BaseController {
public function affectationAction(Request $request) {
die('OKKKK');
}
}
I got error : No route found for "GET /backend"
404 Not Found - NotFoundHttpException
1 linked Exception: ResourceNotFoundException 禄
You may have missed to redefine the indexAction with the proper routing annotation:
/**
* @Route("/", name="easyadmin")
*/
public function indexAction(Request $request)
{
return parent::indexAction($request);
}
The indexAction() method is the only "real controller" because it's the only method associated with a route (all the pages created with EasyAdmin use a single route called easyadmin). It makes some checks and then it redirects to the actual executed method, such as listAction(), showAction(), etc.:
see:
It Work ;) i added indexAction and i correct route Annotation to /backend
Thx A lot
i correct route Annotation to /backend
You should not have to, as you've already prefixed it in your routing config:
easy_admin_bundle:
resource: "@AppBundle/Controller/Admin/AdminController.php"
type: annotation
prefix: /backend
It didn't work when i just added the indexAction so i changed the route annotation :
/**
* @Route("/backend", name="easyadmin")
*/
public function indexAction(Request $request) {
return parent::indexAction($request);
}
@haithem-rihane I think that the problem is the following:
easy_admin_bundle:
resource: "@AppBundle/Controller/Admin/AdminController.php"
type: annotation
prefix: /backend
So you should use instead the following config:
easy_admin_bundle:
resource: "@BackendBundle/Controller/Admin/AdminController.php"
type: annotation
prefix: /backend
I had face same problem. Now it is solved. You can see my solution
Most helpful comment
@haithem-rihane I think that the problem is the following:
So you should use instead the following config: