public function listAction()
    {
        $source = new Entity($this->get('opifer.form.post_manager')->getClass());

        $formColumn = new TextColumn(['id' => 'posts', 'title' => 'Form', 'source' => false, 'filterable' => false, 'sortable' => false, 'safe' => false]);
        $formColumn->manipulateRenderCell(function ($value, $row, $router) {
            return '<a href="'.$this->generateUrl('opifer_form_form_edit', ['id'=> $row->getEntity()->getForm()->getId()]).'">'.$row->getEntity()->getForm()->getName().'</a>';
        });

        $viewAction = new RowAction('view', 'opifer_form_post_view');
        $viewAction->setRouteParameters(['id']);

        $deleteAction = new RowAction('delete', 'opifer_form_post_delete');
        $deleteAction->setRouteParameters(['id']);

        $grid = $this->get('grid');
        $grid->setId('posts')
            ->setSource($source)
            ->setDefaultOrder('id', 'desc')
            ->addColumn($formColumn, 2)
            ->addRowAction($viewAction)
            ->addRowAction($deleteAction);

        return $grid->getGridResponse('OpiferCmsBundle:Backend/Post:list.html.twig');
    }
public function listAction()
    {
        $source = new Entity($this->get('opifer.form.post_manager')->getClass());

        $formColumn = new TextColumn(['id' => 'posts', 'title' => 'Form', 'source' => false, 'filterable' => false, 'sortable' => false, 'safe' => false]);
        $formColumn->manipulateRenderCell(function ($value, $row, $router) {
            return '<a href="'.$this->generateUrl('opifer_form_form_edit', ['id'=> $row->getEntity()->getForm()->getId()]).'">'.$row->getEntity()->getForm()->getName().'</a>';
        });

        $viewAction = new RowAction('view', 'opifer_form_post_view');
        $viewAction->setRouteParameters(['id']);

        $deleteAction = new RowAction('delete', 'opifer_form_post_delete');
        $deleteAction->setRouteParameters(['id']);

        $grid = $this->get('grid');
        $grid->setId('posts')
            ->setSource($source)
            ->setDefaultOrder('id', 'desc')
            ->addColumn($formColumn, 2)
            ->addRowAction($viewAction)
            ->addRowAction($deleteAction);

        return $grid->getGridResponse('OpiferCmsBundle:Backend/Post:list.html.twig');
    }
public function listAction ( ) { $ source = new Entity ( $ this -> get ( 'opifer.form.post_manager' ) -> getClass ( ) ) ; $ formColumn = new TextColumn ( [ 'id' => 'posts' , 'title' => 'Form' , 'source' => false , 'filterable' => false , 'sortable' => false , 'safe' => false ] ) ; $ formColumn -> manipulateRenderCell ( function ( $ value , $ row , $ router ) { return '<a href="' . $ this -> generateUrl ( 'opifer_form_form_edit' , [ 'id' => $ row -> getEntity ( ) -> getForm ( ) -> getId ( ) ] ) . '">' . $ row -> getEntity ( ) -> getForm ( ) -> getName ( ) . '</a>' ; } ) ; $ viewAction = new RowAction ( 'view' , 'opifer_form_post_view' ) ; $ viewAction -> setRouteParameters ( [ 'id' ] ) ; $ deleteAction = new RowAction ( 'delete' , 'opifer_form_post_delete' ) ; $ deleteAction -> setRouteParameters ( [ 'id' ] ) ; $ grid = $ this -> get ( 'grid' ) ; $ grid -> setId ( 'posts' ) -> setSource ( $ source ) -> setDefaultOrder ( 'id' , 'desc' ) -> addColumn ( $ formColumn , 2 ) -> addRowAction ( $ viewAction ) -> addRowAction ( $ deleteAction ) ; return $ grid -> getGridResponse ( 'OpiferCmsBundle:Backend/Post:list.html.twig' ) ; }
Lists all posts from every form

@return Response
Lists all posts from every form