Hello all, this morning I’ve just created a new action (actionCetak) on my controller and view files on views folder, and i created a link on another view file. Everything looks normal, but when I clicked the link, which appears is just a blank page, as if action unable to load the view file. The actionView (Gii generated) show a normal page. Any explanations and solutions are really expected? Thanks.
The Controller :
public function actionView($id)
{
$this->render('view',array(
'model'=>$this->loadModel($id),
));
}
// The new action
public function actionCetak($id)
{
$this->render('cetak',array(
'model'=>$this->loadModel($id),
));
}
public function loadModel($id)
{
$model=MyModel::model()->findByPk((int)$id);
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');
return $model;
}
New View File (cetak.php) :
<div align="center">
<h4>SOME TITLE</h4>
Some Text...
</div>