Hi,
I am new, so maybe my question is trivial.
I have a several report to do, so I would like to keep it in Report model and controller.
How Report model should be defined and how to pass it to the view?
When Report is not based on the database table.
I have tried something like this:
model:
class Report extends CForm
{
public $year;
…
public function init()
{
parent::init();
$this->year = date('Y');
$model->quarter = $this->currentQuarter();
}
…
controller:
public function actionEnrolmentReport()
{
$authManager = Yii::app()->authManager;
$model = new Report(null);
$model->userId = Yii::app()->user->id;
$this->render('EnrolmentReport',array(
'model'=>$model,
'role'=>'Staff',
));
}
when rendering, it complains about missing methods getAttributeLable, hasError, …all these methods for model which extends CActiveRecord.