Пример #1
0
 public function process()
 {
     $newsId = $this->getParam('id');
     $news_model = new News();
     $news = $news_model->filter('id', $newsId)->getOne();
     if ($news) {
         return $this->getViewDispatcher()->renderView(new views\news\NewsItem(), ['pageTitle' => 'Последние новости никарагуа', 'news' => $news]);
     } else {
         throw new \Exception('News ' . $newsId . ' was not found');
     }
 }