Show action for viewing a single entity

@return \Zend\View\Model\ViewModel
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(),
        ));
    }
189253
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->tableName;
            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,
                'resource_route_name'          => $this->model->resource_route_name,
                'table_type_singular'          => strtolower($this->model->model_class),
                'HTMLHelper'                   => HTMLHelper::class,
            ]);
        }

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

        $records = $this->repository->getEmailMessagesForAdminIndex(Auth::user()->id);

        return view('lasallecmsemail::admin/emailhandling/index',
            [
                'records'                      => $records,
                '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,
                'DatesHelper'                  => DatesHelper::class,
                'HTMLHelper'                   => HTMLHelper::class,
                'Config'                       => Config::class,
                'admin_template_name'          => config('lasallecmsadmin.admin_template_name'),
            ]);
    }
438475
public function show($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        $this->checkListParents(false);

        return view($this->getShowView(), [
            'moduleKey'           => $this->moduleKey,
            'routePrefix'         => $this->routePrefix,
            'permissionPrefix'    => $this->permissionPrefix,
            'model'               => $this->modelInformation,
            'record'              => $record,
            'recordReference'     => $this->getReferenceRepository()->getReferenceForModel($record),
            'fieldStrategies'     => $this->renderedShowFieldStrategies($record),
            'hasActiveListParent' => (bool) $this->listParentRelation,
            'topListParentOnly'   => $this->showsTopParentsOnly(),
            'listParents'         => $this->listParents,
        ]);
    }
1324584
public function showAction(Request $request)
    {
        return $this->processView($action = 'show', $this->view($this->find($action)));
    }
342654
public function indexAction()
    {
        $visibilityService = $this->getVisibilityService();
        $options = $visibilityService->getOptions();

        $widgetId = $options->getWidgetId();
        if (! $widgetId) {
            $this->flashMessenger()->addMessage(
                $this->scTranslate('The widget identifier was not specified.')
            );
            return $this->redirect()
                ->toRoute('sc-admin/layout')
                ->setStatusCode(303);
        }

        $widget = $this->deriveWidget($widgetId);
        if (empty($widget)) {
            return $this->getResponse();
        }
        if ($this->getRequest()->isPost()) {
            $event = $this->request->getPost('suboperation');
            if (! empty($event)) {
                $events = $this->getEventManager();
                $params = $this->getRequest()->getPost();
                $params['widget_id'] = $widget->getId();
                $result = $events->trigger($event, $this, $params);
                if ($result->last() instanceof Response) {
                    return $result->last();
                }
            }
        }

        $view = new ViewModel;
        $view->options = $options;
        $view->widget = $widget;

        $moduleOptions = $this->getModuleOptions();
        $view->config = $moduleOptions->getWidgetByName($widget->getName());

        $view->list = $visibilityService->getContentList();
        $visibilityService->saveOptions();

        return $view;
    }
1305437
protected function render()
    {
        if (null === $this->active) {
            $this->setActive(key($this->tabs));
        }

        $tabs       = new ViewModel;
        $tabs->tabs = $this->tabs;

        $tabs->setTemplate('sxbootstrap/tabs/tabs');

        return $this->getView()->render($tabs);
    }
1063374
public function index()
    {
        $roleGrid = new RoleDataGrid($this->repository->query());

        return view('avored-framework::system.role.index')->with('dataGrid', $roleGrid->dataGrid);
    }
61534
public function renderToolProspectsHeaderRefreshAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
        
        $view = new ViewModel();
        $view->melisKey = $melisKey;
        
        return $view;
    }
133742
public function renderMelisCoreGdprContainerAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');

        $view = new ViewModel();
        $view->melisKey = $melisKey;

        return $view;
    }
911006
public function indexAction()
    {
        $optionsProvider = $this->getOptionsProvider();
        if ($this->getRequest()->isPost()) {
            $event = $this->request->getPost('suboperation');
            if (! empty($event)) {
                $events = $this->getEventManager();
                $params = $this->request->getPost();
                $result = $events->trigger($event, $this, $params);
                if ($result->last() instanceof Response) {
                    return $result->last();
                }
            }
        }
        $lists = $this->getContentListProvider();

        $view = new ViewModel([
            'optionsProvider' => $optionsProvider,
            'contentListsProvider' => $lists
        ]);

        $flashMessenger = $this->flashMessenger();
        if ($flashMessenger->hasMessages()) {
            $view->messages = $flashMessenger->getMessages();
        }

        return $view;
    }
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);
    }
297472
public function actionView()
    {
        $path = $this->getPublicPath();
        if (preg_match('@^asset[a-zA-Z0-9]{10}/.*$@', $path)) {
            $path = '/'.substr($path, 16);
        }
        $realPath = \Staq::App()->getFilePath('/public' . $path);
        if (
            empty($realPath) ||
            is_dir($realPath) ||
            \UString::isEndWith($realPath, '.php') /* TODO: Add to settings */
        ) {
            return NULL;
        }
        $this->renderStaticFile($realPath);
        return TRUE;
    }
682112
public function renderCalendarAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $view = new ViewModel();
        $view->melisKey = $melisKey;
        return $view;
    }
1207730
public function microServicesListAction()
    {

        $view         = new ViewModel();
        $translator   = $this->getServiceLocator()->get('translator');
        $apiKey       = trim($this->params()->fromRoute('api_key', ''));
        $userExists   = false;
        $microservice = array();
        $userApiData  = $this->getMicroServiceAuthTable()->getUserByApiKey($apiKey)->current(); 
        $apiStatus    = '';
        $toolTranslator = $this->getServiceLocator()->get('MelisCoreTranslation');
        

        

        if($userApiData) {
            
            $apiStatus = $userApiData->msoa_status;
            // to validate the API key if it's Active or Inactvie
            if($apiStatus){
                $config       = $this->getServiceLocator()->get('MelisCoreConfig');
                $microservice = $config->getItem('microservice');
             
                // set the langauge 
                $melisLangTable = $this->serviceLocator->get('MelisCore\Model\Tables\MelisLangTable');
                $langData = $melisLangTable->getEntryById($userApiData->usr_lang_id)->current();
                if($langData) {
                    $container = new Container('meliscore');
                    $container['melis-lang-locale'] = $langData->lang_locale;
                }

                //Exclude array 'conf' key
                if(array_key_exists('conf',$microservice)){
                    unset($microservice['conf']);
                }
                $userExists   = true;

            }else{
                $message = 'tr_meliscore_microservice_api_key_inactive';

                echo "&nbsp;&nbsp;" .$translator->translate($message);
            }
         
        }
        else{

        }
     
        $view->userExists   = $userExists;
        $view->microservice = $microservice;
        $view->apiKey       = $apiKey;
        $view->title       = 'tr_meliscore_microservice_title';
        return $view;
    }
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'),
            )
        );
    }
731131
public function menuAction()
    {
        $params     = $this->params();
        $navigation = $this->getServiceLocator()
                           ->get( 'Grid\Menu\Model\Menu\Model' )
                           ->findNavigation( $params->fromRoute( 'id' ) );

        $view = new ViewModel( array(
            'navigation' => $navigation,
        ) );

        $this->getResponse()
             ->getHeaders()
             ->addHeaderLine( 'Content-Type', 'application/xml' );

        return $view->setTerminal( true );
    }
1148366
public function indexAction()
    {
        $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user);
        $games = $this->getGameService()->getMissionGames($this->game, $this->user);

        $viewModel = $this->buildView($this->game);
        $viewModel->setVariables(
            array(
            'user'          => $this->user,
            'games'         => $games,
            'entry'         => $entry,
            'flashMessages' => $this->flashMessenger()->getMessages(),
            )
        );

        return $viewModel;
    }