I have come across many posts for 'trying to get property of non-object', but I'm still unable to figure out my problem. I have a webapp and when I create a form it is giving me this error-
view.php:
$this->breadcrumbs=array(
'Events'=>array('index'),
$model->ename, //Error at this line
);
controller:
public function actionView($id)
{
$this->render('view',array(
'model'=>$this->loadModel($id),
));
}
public function loadModel($id)
{
$ename= Event::model()->ename;
$model = Event::model()->findByPk($id,$ename);//tried this since I have composite key
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');
return $model;
}