/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { $model = new Books(); if (isset($_GET["search"])) { $all = $model->searchB($_GET["title_b"], $_GET["author_b"]); } else { $all = $model->getAll(); } $this->render('index', array('allBooks' => $all)); }