src/Admin/CoreAdmin.php
protected function configureRoutes(RouteCollection $collection)
    {
        parent::configureRoutes($collection);
        $collection->add('duplicate', $this->getRouterIdParameter() . '/duplicate');
        $collection->add('generateEntityCode');

        /* Needed or not needed ...
         * in sonata-project/admin-bundle/Controller/CRUDController.php
         * the batchAction method
         * throw exception if the http method is not POST
        */
        if ($collection->get('batch')) {
            $collection->get('batch')->setMethods(['POST']);
        }
    }
protected function configureRoutes(RouteCollection $collection)
    {
        parent::configureRoutes($collection);
        $collection->add('duplicate', $this->getRouterIdParameter() . '/duplicate');
        $collection->add('generateEntityCode');

        /* Needed or not needed ...
         * in sonata-project/admin-bundle/Controller/CRUDController.php
         * the batchAction method
         * throw exception if the http method is not POST
        */
        if ($collection->get('batch')) {
            $collection->get('batch')->setMethods(['POST']);
        }
    }
protected function configureRoutes ( RouteCollection $ collection ) { parent :: configureRoutes ( $ collection ) ; $ collection -> add ( 'duplicate' , $ this -> getRouterIdParameter ( ) . '/duplicate' ) ; $ collection -> add ( 'generateEntityCode' ) ; /* Needed or not needed ...
         * in sonata-project/admin-bundle/Controller/CRUDController.php
         * the batchAction method
         * throw exception if the http method is not POST
        */ if ( $ collection -> get ( 'batch' ) ) { $ collection -> get ( 'batch' ) -> setMethods ( [ 'POST' ] ) ; } }
Configure routes for list actions.

@param RouteCollection $collection
Configure routes for list actions .