src/Controller/GalleryAdminController.php
public function listAction(Request $request = null)
    {
        $this->admin->checkAccess('list');

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $datagrid->setValue('context', null, $this->admin->getPersistentParameter('context'));

        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        return $this->render($this->admin->getTemplate('list'), [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
        ]);
    }
public function listAction(Request $request = null)
    {
        $this->admin->checkAccess('list');

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $datagrid->setValue('context', null, $this->admin->getPersistentParameter('context'));

        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        return $this->render($this->admin->getTemplate('list'), [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
        ]);
    }
public function listAction ( Request $ request = null ) { $ this -> admin -> checkAccess ( 'list' ) ; if ( $ listMode = $ request -> get ( '_list_mode' ) ) { $ this -> admin -> setListMode ( $ listMode ) ; } $ datagrid = $ this -> admin -> getDatagrid ( ) ; $ datagrid -> setValue ( 'context' , null , $ this -> admin -> getPersistentParameter ( 'context' ) ) ; $ formView = $ datagrid -> getForm ( ) -> createView ( ) ; // set the theme for the current Admin Form $ this -> setFormTheme ( $ formView , $ this -> admin -> getFilterTheme ( ) ) ; return $ this -> render ( $ this -> admin -> getTemplate ( 'list' ) , [ 'action' => 'list' , 'form' => $ formView , 'datagrid' => $ datagrid , 'csrf_token' => $ this -> getCsrfToken ( 'sonata.batch' ) , ] ) ; }
return the Response object associated to the list action.

@param Request $request

@return Response
return the Response object associated to the list action .