Display a list of page.

@return Response
355481
public function index(PageRequest $request)
    {
        if ($this->response->typeIs('json')) {
            $pageLimit = $request->input('pageLimit');
            $data      = $this->repository
                ->setPresenter(\Litecms\Page\Repositories\Presenter\PageListPresenter::class)
                ->getDataTable($pageLimit);
            return $this->response
                ->data($data)
                ->output();
        }

        $pages = $this->repository->paginate();

        return $this->response->setMetaTitle(trans('page::page.names'))
            ->view('page::page.index')
            ->data(compact('pages'))
            ->output();
    }
266541
public function listAction()
    {
        $params     = $this->params();
        $request    = $this->getRequest();
        $bodyOnly   = $request->isXmlHttpRequest();
        $page       = $params->fromRoute( 'page',
            $request->getPost( 'page',
                $request->getQuery( 'page', 1 )
            )
        );

        $view = new ViewModel( array(
            'paginator' => $this->getPaginator(),
            'page'      => ( (int) $page ) ?: 1,
            'format'    => $bodyOnly,
        ) );

        if ( $bodyOnly )
        {
            $view->setTerminal( true );
        }

        return $view;
    }
591730
public function index() {
        // Is this user allowed to do this?
        if (!$this->repository->isUserAllowed('index'))
        {
            Session::flash('status_code', 400 );
            $message = "You are not allowed to view the list of ".$this->table_name;
            Session::flash('message', $message);
            return view('formhandling::warnings/' . config('lasallecmsadmin.admin_template_name') . '/user_not_allowed', [
                'package_title'        => $this->model->package_title,
                'table_type_plural'    => $this->model->table,
                'table_type_singular'  => strtolower($this->model->model_class),
                'resource_route_name'  => $this->resource_route_name,
                'HTMLHelper'           => HTMLHelper::class,
                'Crypt'                => Crypt::class,
            ]);
        }


        // If this user has locked records for this table, then unlock 'em
        $this->repository->unlockMyRecords($this->model->table);

        return view('formhandling::adminformhandling/' . config('lasallecmsadmin.admin_template_name') . '/index',
        [
            'display_the_view_button'      => $this->model->display_the_view_button,
            'records'                      => $this->repository->getAll(),
            'repository'                   => $this->repository,
            'package_title'                => $this->model->package_title,
            'table_name'                   => $this->model->table,
            'model_class'                  => $this->model->model_class,
            'resource_route_name'          => $this->model->resource_route_name,
            'field_list'                   => $this->getFieldList(),
            'suppress_delete_button_when_one_record' => $this->model->suppress_delete_button_when_one_record,
            'DatesHelper'                  => DatesHelper::class,
            'HTMLHelper'                   => HTMLHelper::class,
            'carbon'                       => Carbon::class,
            'Config'                       => Config::class,
            'Form'                         => Form::class,
            'Crypt'                        => Crypt::class,
        ]);
    }
142016
public function index()
    {
        return $this->render('index', [
            'pages' => $this->model->getNavItemPageBlockItems()->select(['nav_item_page_id'])->distinct()->orderBy([])->all(),
        ]);
    }
860321
public function index()
    {
        $templates = IncidentTemplate::query();

        if ($sortBy = Binput::get('sort')) {
            $direction = Binput::has('order') && Binput::get('order') == 'desc';

            $templates->sort($sortBy, $direction);
        }

        $templates = $templates->paginate(Binput::get('per_page', 20));

        return $this->paginator($templates, Request::instance());
    }
423743
public function index()
    {
        $result = $this->repository->paginated();

        return view('cms::modules.files.index')
            ->with('files', $result)
            ->with('pagination', $result->render());
    }
600761
public function listAction()
    {
        $page = $this->getRequest()->getQuery('page', 0);
        $limit = $this->getRequest()->getQuery('limit', $this->defaultPageSize);
        $sort = $this->getRequest()->getQuery('sort', $this->defaultSort);
        $order = $this->getRequest()->getQuery('order', $this->defaultOrder);

        if (empty($sort)) {
            $sort = $this->defaultSort;
        }

        $offset = $limit * $page - $limit;
        if ($offset < 0) {
            $offset = 0;
        }

        /* @var $qb \Doctrine\ODM\MongoDB\Query\Builder */
        $qb = $this->getDocumentManager()->createQueryBuilder($this->getDocumentClass());
        $qb->select()
        ->sort($sort, $order)
        ->limit($limit)
        ->skip($offset);

        $this->handleSearch($qb);

        $paginator = new Paginator(new DoctrinePaginator($qb->getQuery()->execute()));
        $paginator->setDefaultItemCountPerPage($limit);
        $paginator->setCurrentPageNumber($page);
        $paginator->setPageRange($this->paginatorRange);

        return [
            'paginator' => $paginator,
            'sort' => $sort,
            'order' => $order,
            'page' => $page,
            'query' => $this->params()->fromQuery(),
        ];
    }
1165954
public function index()
    {
        // Respond with pagination
        return json()->setMeta(['version' => 1])->withPagination(
            $this->model->with('author')->latest()->paginate(5),
            new BookTransformer
        );

        // Respond as a collection
        //return json()->setMeta(['version' => 1])->withCollection(
        //    $this->model->with('author')->latest()->get(),
        //    new BookTransformer
        //);
    }
327234
public function listAction()
    {
        $request = $this->getRequest();

        $this->admin->checkAccess('list');

        $preResponse = $this->preList($request);
        if (null !== $preResponse) {
            return $preResponse;
        }

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

        $datagrid = $this->admin->getDatagrid();
        $formView = $datagrid->getForm()->createView();

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

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('list');
        // $template = $this->templateRegistry->getTemplate('list');

        return $this->renderWithExtraParams($template, [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
            'export_formats' => $this->has('sonata.admin.admin_exporter') ?
                $this->get('sonata.admin.admin_exporter')->getAvailableFormats($this->admin) :
                $this->admin->getExportFormats(),
        ], null);
    }
1263010
public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 25;

        if (!empty($keyword)) {
            $pages = Page::where('title', 'LIKE', "%$keyword%")
                ->orWhere('content', 'LIKE', "%$keyword%")
                ->latest()->paginate($perPage);
        } else {
            $pages = Page::latest()->paginate($perPage);
        }

        return view('admin.pages.index', compact('pages'));
    }
290642
public function index()
    {
        $this->authorize(PermissionsPolicy::PERMISSION_LIST);

        $permissions = $this->permission->with(['group'])
            ->withCount(['roles'])
            ->orderBy('group_id')
            ->paginate($this->perPage);

        $this->setTitle($title = trans('auth::permissions.titles.permissions-list'));
        $this->addBreadcrumb($title);

        return $this->view('admin.permissions.index', compact('permissions'));
    }
1042277
protected function getListPage()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        $list = (array) $this->page->getList($conditions);
        $this->prepareListPage($list);
        return $list;
    }
1172325
public function showPage($pageName = 'index')
    {
        if (!$this->page->exists($pageName)) {
            return \Response::view($this->theme.'.404', array('global' => $this->global), 404);
        }

        $page = $this->page->get($pageName);

        $viewParamaters = array(
            'global' => $this->global,
            'page' => $page
        );

        if (\View::exists($this->theme.'.'.$pageName)) {
            return \View::make($this->theme.'.'.$pageName, $viewParamaters);
        } else {
            return \View::make($this->theme.'.page', $viewParamaters);
        }
    }
531708
public function showList(array $request = ['page' => 1])
    {
        if (isset($_GET['page']) === false) {
            $_GET['page'] = $request['page'] = 1;
        }
        $pages_list = [];
        $auth = $this->core->auth();
        $paginated = false;
        if ($auth->allow(["min" => 2, "max" => 1]) === true) {
            if ($request['page'] == 0) {
                $pages_list = $this->core->api('Page/all', 'GET')->run();
            } else {
                $paginated = true;
                $pages_list = $this->core->api('Page/all', 'GET')->run([
                    "paginate" => 15
                ]);
                $pages_list['response']->withPath(web_admin_path() . "Core-Framework/pages/");
            }
            if (($pages_list["headers"][0][2] - 200) * ($pages_list["headers"][0][2] - 299) > 0) {
                if (headers_sent() === false) {
                    foreach ($pages_list["headers"] as $header) {
                        header($header[0], $header[1], $header[2]);
                    }
                }
                return $this->templates->render("500", [
                    "error" => $pages_list['response'],
                    "result" => ''
                ]);
            }
            $pages_list = $pages_list['response'];
        } elseif ($auth->allow(["min" => 3, "max" => 3]) === true) {
            if ($request['page'] == 0) {
                $pages_list = $auth->details->pages()->get();
            } else {
                $paginated = true;
                $pages_list = $auth->details->pages()->paginate(15);
                $pages_list->withPath(web_admin_path() . "Core-Framework/pages/");
            }
        }

        $messages = [
            'error' => '',
            'info' => '',
            'success' => '',
            'warning' => ''
        ];
        if (empty($request['m']) === false) {
            if ($request['m'] == 1) {
                if (headers_sent() === false) {
                    header('X-PHP-Response-Code: 202', true, 202);
                }
                $messages['success'] = 'Page deleted successfully.';
            } elseif ($request['m'] == 2) {
                if (headers_sent() === false) {
                    header('X-PHP-Response-Code: 422', true, 422);
                }
                $messages['error'] = 'Error - Page not found.';
            }
        }

        return $this->templates->render("Main::Pages/List", [
            "messages" => $messages,
            "paginated" => $paginated,
            "pages" => $pages_list
        ]);
    }
407196
public function listAction(Request $request)
    {
        return $this->render('SynapsePageBundle:Admin/Page:list.html.twig', array(
            'pages' => $this->container->get('synapse.page.loader')->retrieveAll(),
            'page_rendering_route' => $this->container->getParameter('synapse.page.rendering_route'),
        ));
    }
1091933
public function indexAction()
    {
        $footerContentId = $this->container->getParameter('ezdemo.footer.content_id');
        $footerContent = $this->getRepository()->getContentService()->loadContent($footerContentId);

        $response = new Response();
        $response->setPublic();
        $response->setSharedMaxAge(86400);
        $response->headers->set('X-Location-Id', $footerContent->contentInfo->mainLocationId);
        $response->setVary('X-User-Hash');

        return $this->render(
            'eZDemoBundle::page_footer.html.twig',
            array('content' => $footerContent),
            $response
        );
    }
794505
public function listAction($page = 1)
    {
        $paginator = $this->get("knp_paginator");

        if ($paginator instanceof \Knp\Component\Pager\Paginator) ;

        $query = $this->getPaginatorQuery();

        if ($this->getRequest()->get("sort")) {
            $query->orderBy($this->getRequest()->get("sort"), strtolower($this->getRequest()->get("direction")) == "asc" ? "asc" : "desc");
        }

        $pagination = $paginator->paginate(
            $query,
            $page
        );

        $pagination->setTemplate('KnpPaginatorBundle:Pagination:twitter_bootstrap_v3_pagination.html.twig');

        return array(
            'page' => $page,
            'pagination' => $pagination,
            'sort' => $this->getRequest()->get('sort'),
            'direction' => $this->getRequest()->get('direction'),
            'route' => $this->getRouteName(),
            'routeParams' => $this->getRouteParams(),
            'template' => $this->getListTemplate()
        );
    }