Index action for viewing a pagination list

@return ViewModel
12608
public function indexAction()
    {
        $query = (string) $this->params()->fromQuery('query', null);
        $query = strlen($query) > 0 ? $query : null;

        $orderBy = (string) $this->params()->fromQuery('orderBy', null);
        $orderBy = strlen($orderBy) > 0 ? $orderBy : null;

        $sort = (string) $this->params()->fromQuery('sort', null);
        $sort = strlen($sort) > 0 ? $sort : null;

        $page  = (int) $this->params()->fromRoute('page', 1);
        $limit = $this->getOptions()->getDefaultItemsPerPage();

        $entities = $this->getService()->pagination($page, $limit, $query, $orderBy, $sort);

        $view = new ViewModel(array(
            'options'  => $this->getOptions(),
            'entities' => $entities,
            'query'    => $query,
            'orderBy'  => $orderBy,
            'sort'     => $sort,
        ));

        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,
        ]);
    }
423743
public function index()
    {
        $result = $this->repository->paginated();

        return view('cms::modules.files.index')
            ->with('files', $result)
            ->with('pagination', $result->render());
    }
229767
public function index()
    {
        $blogs = $this->repository->paginated();

        return view('cms::modules.blogs.index')
            ->with('blogs', $blogs)
            ->with('pagination', $blogs->render());
    }
174842
public function indexAction()
    {
        $pageName = $this->getEvent()
            ->getRouteMatch()
            ->getParam('page', 'index');

        $pageType = $this->getEvent()
            ->getRouteMatch()
            ->getParam('pageType', PageTypes::NORMAL);

        $pageRevisionId = $this->getEvent()
            ->getRouteMatch()
            ->getParam('revision', null);

        return $this->getCmsResponse(
            $this->currentSite,
            $pageName,
            $pageType,
            $pageRevisionId
        );
    }
1180799
public function indexAction()
    {
        return $this->forward()
                    ->dispatch(
                        $this->params()
                             ->fromRoute( 'controller', get_called_class() ),
                        array(
                            'action' => 'list',
                            'locale' => (string) $this->locale(),
                        )
                    );
    }
1085821
public function index()
    {
        $modules = Module::all();
        $moduleDataGrid = new ModuleDataGrid($modules);

        return view('avored-framework::system.module.index')
            ->with('modules', $modules)
            ->with('dataGrid', $moduleDataGrid->dataGrid);
    }
888415
public function paginate()
    {
        $model = $this->model;

        if (property_exists($model, 'order')) {
            $paginator = $model::orderBy($model::$order, $model::$sort)->paginate($model::$paginate, $model::$index);
        } else {
            $paginator = $model::paginate($model::$paginate, $model::$index);
        }

        if (!$this->isPageInRange($paginator) && !$this->isFirstPage($paginator)) {
            throw new NotFoundHttpException();
        }

        if (count($paginator)) {
            $this->paginateLinks = $paginator->render();
        }

        return $paginator;
    }
1293700
public function indexAction()
    {
        $form = $this->formSearch;

        if ($this->getRequest()
                 ->isPost()
        ) {
            $form->setData(
                $this->params()
                     ->fromPost()
            );

            if ($form->isValid()) {
                return $this->redirect()
                            ->toRoute(
                                'mp3-search',
                                [
                                    'name' => $this->params()
                                                   ->fromPost('name')
                                ]
                            );
            }
        }

        $service = $this->serviceIndex
            ->index(
                $this->params()
                     ->fromRoute()
            );

        return (new ViewModel())
            ->setTemplate('mp3/mp3/search')
            ->setVariables(
                [
                    'form'          => $form,
                    'paginator'     => $service['paginator'],
                    'path'          => $service['path'],
                    'totalLength'   => $service['totalLength'],
                    'totalFileSize' => $service['totalFileSize'],
                    'search'        => $service['search'],
                    'dir'           => $this->params()
                                            ->fromRoute('dir')
                ]
            );
    }
709144
public function listAction()
    {
        $params = $this->params();
        $page   = (int) $params->fromRoute( 'page' );
        $mode   = $params->fromRoute( 'mode' );
        $all    = $mode == 'all';
        $tags   = array_map(
            'rawurldecode',
            explode( '/', $params->fromRoute( 'tags' ) )
        );

        $paginator = $this->getServiceLocator()
                          ->get( 'Grid\Paragraph\Model\Paragraph\Model' )
                          ->getContentPaginatorByTags( $tags, $all );

        $this->paragraphLayout();

        return array(
            'paginator'         => $paginator,
            'page'              => $page,
            'mode'              => $mode,
            'tags'              => $tags,
        );
    }
1090198
public function index() {
        $this->paginate = array_merge(array(
            'limit' => 25,
            'order' => array('ItemReport.' . $this->Model->displayField => 'ASC'),
            'contain' => array_keys($this->Model->belongsTo),
            'conditions' => array('ItemReport.status' => ItemReport::PENDING)
        ), $this->Model->admin['paginate']);

        $this->AdminToolbar->setBelongsToData($this->Model);

        $this->request->data['ItemReport']['status'] = ItemReport::PENDING;

        // Filters
        if (!empty($this->request->params['named'])) {
            $this->paginate['conditions'] = $this->AdminToolbar->parseFilterConditions($this->Model, $this->request->params['named']);
        }

        $this->set('results', $this->paginate($this->Model));
    }
500261
public function indexAction()
    {
        $pager = $this->get('sonata.classification.manager.collection')
            ->getRootCollectionsPager($this->getCurrentRequest()->get('page'));

        return $this->render('SonataProductBundle:Collection:index.html.twig', [
            'pager' => $pager,
        ]);
    }
1342173
public function index()
    {
        $propertyGrid = new Property(Model::query()->orderBy('id', 'desc'));

        return view('avored-ecommerce::property.index')->with('dataGrid', $propertyGrid->dataGrid);
    }
571299
public function actionList()
    {
        $searchModel = new SearchFavoriteProduct();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('list', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
822333
public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $pages = $em->getRepository('CoreBundle:Page')->findAll();

        return array(
            'pages' => $pages,
        );
    }
1099529
public function index(): View
    {
        $config = [
            'title' => trans('HCResource::resource_grab_property.page_title'),
            'url' => route('admin.api.resource.grab.property'),
            'form' => route('admin.api.form-manager', ['resource.grab.property']),
            'headers' => $this->getTableColumns(),
            'actions' => ['search']
        ];

        return view('HCCore::admin.service.index', ['config' => $config]);
    }
995499
public function actionPagination()
    {
        Yii::$app->session->set($this->MainModel . 'Pagination', Yii::$app->request->queryParams['records']);
        $this->redirect(['index']);
    }