for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PiedWeb\CMSBundle\Admin;
use Sonata\AdminBundle\Controller\CRUDController;
class PageAdminCRUDController extends CRUDController
{
public function listAction()
$request = $this->getRequest();
if ($listMode = $request->get('_list_mode')) {
$this->admin->setListMode($listMode);
}
$listMode = $this->admin->getListMode();
if ('tree' === $listMode) {
return $this->treeAction();
return parent::listAction();
public function treeAction()
$pages = $this->getDoctrine()
->getRepository($this->container->getParameter('pwc.entity_page'))
->getPagesWithoutParent();
return $this->renderWithExtraParams('@PiedWebCMS/admin/page_treeView.html.twig', [
'pages' => $pages,
'list' => $this->admin->getList(),
'admin' => $this->admin,
'base_template' => $this->getBaseTemplate(),
'action' => 'list',
]);