To remove one route from the Admin class, use
protected function configureRoutes(RouteCollection $collection) { $collection->remove('edit'); }
In Symfony 2.1 +, you can use clearExcept to delete all routes except those specified, for example this:
public function configureRoutes(RouteCollection $collection) { $collection->clearExcept(array('list', 'edit', 'delete', 'batch')) }
This has the advantage that you save your actions as they are when you add new actions to the SonataAdminBundle .
Symfony 2.0 has a similar undocumented feature (thanks to Jeroen):
public function configureRoutes(RouteCollection $collection) { $collection->removeAllExcept(array('list', 'edit', 'delete', 'batch')) }
likeitlikeit
source share