This method will render the list of news

@return \Zend\View\Model\ViewModel
494162
public function listAction()
    {
        // Getting the Site config "MelisDemoCms.config.php"
        $siteConfig = $this->getServiceLocator()->get('config');
        $siteConfig = $siteConfig['site']['MelisDemoCms'];
        $siteDatas = $siteConfig['datas'];
        
        /**
         * Listing News using MelisCmsNewsListNewsPlugin
         */
		$listNewsPluginView = $this->MelisCmsNewsListNewsPlugin();
		$listNewsParameters = array(
		    'template_path' => 'MelisDemoCms/plugin/news-list',
            'pageId' => $this->idPage,
            'pageIdNews' => $siteDatas['news_details_page_id'],
	        'pagination' => array(
	            'nbPerPage' => 6
	        ),
	        'filter' => array(
	            'column' => 'cnews_publish_date',
	            'order' => 'DESC',
	            'unpublish_filter' => true,
	            'site_id' => $siteDatas['site_id'],
	        )
		);
		
		// add generated view to children views for displaying it in the contact view
		$this->view->addChild($listNewsPluginView->render($listNewsParameters), 'listNews');
        
		$this->view->setVariable('renderMode', $this->renderMode);
        $this->view->setVariable('idPage', $this->idPage);
        return $this->view;
    }
1355526
public function listAction()
    {
        $channel = $this->params()->fromRoute('channel', 'default');

        /* @var Paginator $paginator */
        $paginator = $this->paginator('Jobs/Job', ['channel' => $channel ]);

        $viewModel=new ViewModel();
        $viewModel->setVariables(
            [
                'jobs' => $paginator,
                'channel' => $channel
            ]
        );

        $viewModel->setTemplate('jobs/export/feed');

        return $viewModel;
    }
1362980
public function actionIndex()
    {
        $filterModel = new Search($this->type);
        return $this->render('index', [
            'filterModel'  => $filterModel,
            'dataProvider' => $filterModel->search(\Yii::$app->request->get()),
        ]);
    }
423119
public function nextNews()
    {
        $next = $this->newsManager()->next();

        if (!$next) {
            return null;
        }

        return $this->newsFormatNav($next);
    }
336991
public function getList()
    {
        /** @var DataList $list */
        $list = parent::getList();
        if ($this->modelClass === 'News' && class_exists('Subsite') && Subsite::currentSubsiteID() > 0) {
            $pages = NewsHolderPage::get()->filter(array('SubsiteID' => (int)Subsite::currentSubsiteID()));
            $filter = $pages->column('ID');
            /* Manual join needed because otherwise no items are found. Unknown why. */
            $list = $list->innerJoin('NewsHolderPage_Newsitems', 'NewsHolderPage_Newsitems.NewsID = News.ID')
                ->filter(array('NewsHolderPage_Newsitems.NewsHolderPageID' => $filter));
        }

        return $list;
    }
667491
public function actionIndex() {
        $languageForm = Yii::createObject([
                    'class' => Language::className(),
                    'scenario' => 'create'
        ]);
        $filterModel = Yii::createObject([
                    'class' => Language::className(),
                    'scenario' => 'search'
        ]);
        Yii::$app->view->title = Yii::t('multilang', 'Languages');
        return $this->render('index', [
                    'filterModel' => $filterModel,
                    'dataProvider' => $filterModel->search(Yii::$app->request->get()),
                    'languageForm' => $languageForm
        ]);
    }
957933
public function render()
    {
        if ($this->showAs->isNotEmpty()) {
            $this->showAs->each(function ($callable) {
                $this->value = $callable->call(
                    $this->parent->getModel(),
                    $this->value
                );
            });
        }

        return view($this->view, $this->variables());
    }
1092769
public function renderToolProspectsWidgetsContentAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
    
        $view = new ViewModel();
        $view->melisKey = $melisKey;
    
        return $view;
    }
542136
public function getList()
    {
        $pageType = $this->params('pageType', PageTypes::NORMAL);
        $pageId = $this->params('pageId', null);

        /** @var \Rcm\Validator\Page $validator */
        $validator = clone($this->getServiceLocator()->get(\Rcm\Validator\Page::class));
        $validator->setPageType($pageType);

        $return = [
            'valid' => true
        ];

        if (!$validator->isValid($pageId)) {
            $return['valid'] = false;
            $return['error'] = $validator->getMessages();

            /** @var \Zend\Http\Response $response */
            $response = $this->response;

            $errorCodes = array_keys($return['error']);

            foreach ($errorCodes as &$errorCode) {
                if ($errorCode == $validator::PAGE_EXISTS) {
                    $response->setStatusCode(409);
                    break;
                } elseif ($errorCode == $validator::PAGE_NAME) {
                    $response->setStatusCode(417);
                }
            }
        }

        return new JsonModel($return);
    }
21600
public function render()
    {
        // get messages
        $allMessages = [
            'danger'  => array_unique(
                array_merge(
                    $this->flashMessenger->getErrorMessages(),
                    $this->flashMessenger->getCurrentErrorMessages()
                )
            ),
            'success' => array_unique(
                array_merge(
                    $this->flashMessenger->getSuccessMessages(),
                    $this->flashMessenger->getCurrentSuccessMessages()
                )
            ),
            'warning' => array_unique(
                array_merge(
                    $this->flashMessenger->getWarningMessages(),
                    $this->flashMessenger->getCurrentWarningMessages()
                )
            ),
            'info'    => array_unique(
                array_merge(
                    $this->flashMessenger->getInfoMessages(),
                    $this->flashMessenger->getCurrentInfoMessages()
                )
            ),
            'default' => array_unique(
                array_merge(
                    $this->flashMessenger->getMessages(),
                    $this->flashMessenger->getCurrentMessages()
                )
            ),
        ];

        // clear messages
        $this->flashMessenger->clearMessagesFromContainer();
        $this->flashMessenger->clearCurrentMessagesFromContainer();

        // initialize output
        $output = '';

        // loop through messages
        foreach ($allMessages as $groupKey => $groupMessages) {
            foreach ($groupMessages as $message) {
                $addClass = $groupKey == 'default' ? '' : 'alert-' . $groupKey;

                // setup view model
                $viewModel = new ViewModel();
                $viewModel->setVariable('alertClass', $addClass);
                $viewModel->setVariable('alertMessage', $message);
                $viewModel->setTemplate('zfrapid-library/widget/bootstrap-alert');

                // add rendered output
                $output .= $this->getView()->render($viewModel);
            }
        }

        // return output
        return $output . "\n";
    }
484860
public function render()
    {
        if ($this->getView() === null) {
            $this->setView(new TemplateView('controls/column_sorting'));
        }
        $this->getView()->mergeData([
            'order' => $this->getDirection(),
            'links' => $this->makeLinks()
        ]);
        return parent::render();
    }
857041
public function rss()
    {
        /** @var RSSFeed $rss */
        $rss = RSSFeed::create(
            $list = $this->getRSSFeed(), $link = $this->Link('rss'), $title = _t('News.RSSFEED', 'News feed')
        );

        return $rss->outputToBrowser();
    }
1104364
public function transformMpNews($news)
    {
        $articles = [];

        if (!is_array($news)) {
            $news = [$news];
        }

        foreach ($news as $item) {
            $articles[] = [
                'title'              => $item->get('title'),
                'thumb_media_id'     => $item->get('thumb_media_id'),
                'author'             => $item->get('author'),
                'content_source_url' => $item->get('content_source_url'),
                'content'            => $item->get('content'),
                'digest'             => $item->get('digest'),
                'show_cover_pic'     => $item->get('show_cover_pic'),
            ];
        }

        return ['msgtype' => 'mpnews', 'news' => ['articles' => $articles]];
    }
989140
public function prevNews()
    {
        $prev = $this->newsManager()->prev();

        if (!$prev) {
            return null;
        }

        return $this->newsFormatNav($prev);
    }
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;
    }
1097513
public function sendNews(){
        $news   = func_get_args();
        $openid = array_shift($news);
        return $this->messageCustomSend($openid, $news, self::MSG_TYPE_NEWS);
    }
546251
protected function getCurrentNewsCategories()
    {
        if (!($alias = Input::getAutoItem('items', false, true))
            || null === ($news = NewsModel::findPublishedByParentAndIdOrAlias($alias, $this->news_archives))
        ) {
            return [];
        }

        $ids = Model::getRelatedValues('tl_news', 'categories', $news->id);
        $ids = \array_map('intval', \array_unique($ids));

        return $ids;
    }