Index action.

@return ViewModel
328864
public function indexAction()
    {
        // Clear the user identity, if any. (#370)
        if (PHP_SESSION_ACTIVE !== session_status()) {
            session_start();
        }
        session_destroy();

        $form    = $this->installForm;
        $prereqs = $this->plugin('Install/Prerequisites')->check();
    
        return $this->createViewModel(
            array(
                'prerequisites' => $prereqs,
                'form'          => $form,
                'lang'          => $this->params('lang'),
            )
        );
    }
1362980
public function actionIndex()
    {
        $filterModel = new Search($this->type);
        return $this->render('index', [
            'filterModel'  => $filterModel,
            'dataProvider' => $filterModel->search(\Yii::$app->request->get()),
        ]);
    }
1230679
public function indexAction()
    {
        $this->view->user = (new \Cms\Orm\CmsAuthQuery)->findPk(\App\Registry::$auth->getId());
    }
527089
public function indexAction()
    {
        $isSubscribed = false;

        $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user);
        if ($entry) {
            $isSubscribed = true;
        }

        $viewModel = $this->buildView($this->game);
        $viewModel->setVariables(array(
            'isSubscribed' => $isSubscribed,
        ));

        return $viewModel;
    }
445436
public function actionIndex()
    {
        /** @var \amnah\yii2\user\models\search\UserSearch $searchModel */
        $searchModel = $this->module->model("UserSearch");
        $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());

        return $this->render('index', compact('searchModel', 'dataProvider'));
    }
108087
public function actionIndex()
    {
        $searchModel = new MessageSearch;
        $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
        return $this->render('index', compact('dataProvider', 'searchModel'));
    }
316085
public function indexAction()
    {
        // To begin the step of installation, the user must click "continue".
        if (! $this->params()->fromRoute('process')) {
            return new ViewModel();
        }

        $installation = $this->getInstallation();
        $redirect     = $this->getRedirect();
        $step         = $installation->getCurrentStep();
        $member       = $step->getCurrentMember();
        $service      = $this->getService();
        $validator    = $this->getValidator();

        foreach ($member as $item) {
            if (! $validator->isValid($item)) {
                if (! $service->process($item)) {
                    return new ViewModel([
                        'errors' => $service->getMessages()
                    ]);
                }
            }
        }
        return $this->redirect()->toUrl($redirect);
    }
1218615
public function indexAction()
    {
        if ($this->auth->hasIdentity()) {
            return $this->redirect()->toRoute('lang');
        }

        $viewModel        = new ViewModel();
        /* @var $loginForm Login */
        $loginForm        = $this->forms[self::LOGIN];
        /* @var $registerForm Register */
        $registerForm = $this->forms[self::REGISTER];

        /* @var $request \Zend\Http\Request */
        $request   = $this->getRequest();

        if ($request->isPost()) {
            $data                          = $this->params()->fromPost();
            $adapter                       = $this->userLoginAdapter;
            // inject suffixes via shared Events
            $loginSuffix                   = '';
            // @TODO: replace this by the Plugin LoginFilter
            $e                             = $this->getEvent();
            $loginSuffixResponseCollection = $this->getEventManager()->trigger('login.getSuffix', $e);
            if (!$loginSuffixResponseCollection->isEmpty()) {
                $loginSuffix = $loginSuffixResponseCollection->last();
            }

            $loginForm->setData($data);
            if (array_key_exists('credentials', $data) &&
                array_key_exists('login', $data['credentials']) &&
                array_key_exists('credential', $data['credentials'])) {
                $adapter->setIdentity($data['credentials']['login'] . $loginSuffix)
                    ->setCredential($data['credentials']['credential']);
            }
            
            $auth   = $this->auth;
            $result = $auth->authenticate($adapter);
            
            
            if ($result->isValid()) {
                $user = $auth->getUser();
                $language = $this->locale->detectLanguage($request, $user);
                $this->logger->info('User ' . $user->getLogin() . ' logged in');
                
                $ref = $this->params()->fromQuery('ref', false);

                if ($ref) {
                    $ref = urldecode($ref);
                    $url = preg_replace('~/[a-z]{2}(/|$)~', '/' . $language . '$1', $ref);
                    $url = $request->getBasePath() . $url;
                } else {
                    $urlHelper = $this->viewHelperManager->get('url');
                    $url = $urlHelper('lang', array('lang' => $language));
                }
                $this->notification()->success(/*@translate*/ 'You are now logged in.');
                return $this->redirect()->toUrl($url);
            } else {
                $loginName = $data['credentials']['login'];
                if (!empty($loginSuffix)) {
                    $loginName = $loginName . ' (' . $loginName . $loginSuffix . ')';
                }
                $this->logger->info('Failed to authenticate User ' . $loginName);
                $this->notification()->danger(/*@translate*/ 'Authentication failed.');
            }
        }
        
        $ref = $this->params()->fromQuery('ref', false);
        
        if ($ref) {
            $req = $this->params()->fromQuery('req', false);
            if ($req) {
                $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);
                $viewModel->setVariable('required', true);
            }
            $viewModel->setVariable('ref', $ref);
        }

        $allowRegister = $this->options->getEnableRegistration();
        $allowResetPassword = $this->options->getEnableResetPassword();
        if (isset($allowRegister)) {
            $viewModel->setVariables(
                [
                    'allowRegister' => $allowRegister,
                    'allowResetPassword' => $allowResetPassword
                ]
            );
        }

        $viewModel->setVariable('loginForm', $loginForm);
        $viewModel->setVariable('registerForm', $registerForm);

        /* @deprecated use loginForm instead of form in your view scripts */
        $viewModel->setVariable('form', $loginForm);


        return $viewModel;
    }
822333
public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

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

        return array(
            'pages' => $pages,
        );
    }
189602
public function showAction()
    {
        $id = (int) $this->params()->fromRoute('id', null);

        $service = $this->getService();
        $entity  = $service->getById($id);

        return new ViewModel(array(
            'entity'  => $entity,
            'options' => $this->getOptions(),
        ));
    }
195261
public function actionIndex()
    {
        $model = Yii::createObject($this->modelClass);

        return $this->render('index', ['routes' => $model->getAvailableAndAssignedRoutes()]);
    }
621717
public function actionList()
    {
        $models = $this->getNewEntity()->fetchAll();
        $view = $this->createView('list');
        $view['content'] = $models;
        return $view;
    }
1340150
public function indexAction()
    {
        $this->get('profiler')->disable();

        $messageListDTO = $this->get('cocorico.swift_reader.message_manager')
            ->getMessageListDTO();

        return $this->render(
            'CocoricoSwiftReaderBundle:Message:index.html.twig',
            array(
                'messages' => $messageListDTO->messages
            )
        );
    }
1150307
public function index()
    {
        $pageGrid = new PageDataGrid($this->repository->query());
        return view('avored-framework::cms.page.index')
            ->with('dataGrid', $pageGrid->dataGrid);
    }
154154
public function index()
    {
        // Look for overriden views
        $this->overrideViews();

        // Get models to show
        $results = $this->makeIndexQuery()->paginate($this->perPage());

        // Render the view using the `listing` builder
        $listing = Listing::createFromController($this, $results);
        if ($this->parent) {
            $listing->parent($this->parent);

            // The layout header may have a many to many autocomplete
            $this->layout->with($this->autocompleteViewVars());
        }

        // Render view
        return $this->populateView($listing);
    }
842075
public function actionIndex()
    {
        $searchModel = $this->findModel(null, true);
        $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());

        return $this->render('index', [
            'dataProvider' => $dataProvider,
            'searchModel' => $searchModel,
        ]);
    }
249051
public function indexAction()
    {
        $this->view->data = array();
        $s = $this->_getSelectIndex();
        if ($this->_loadColumns) {
            foreach ($this->_loadColumns as $c) {
                $s->expr($c);
            }
        }
        foreach ($this->_model->getRows($s) as $row) {
            $this->view->data[] = $this->_loadDataFromRow($row);
        }
        $this->view->total = $this->_model->countRows($s);
    }