public function actionOne() { if (empty($_GET['id'])) { $message = 'There is no such news '; $this->errMSG($message); } else { $article = new NewsModel(); $article->id = $_GET['id']; $view = new View(); $view->item = $article->findOneByPK(); $view->display('news/one.php'); } }
public function actionAll() { $article = NewsModel::findOneByPK(1); echo $article; }