hello there,
i get this error :
Fatal error: Call to a member function getErrors() on a non-object in /public_html/framework/yii/framework/web/helpers/CHtml.php on line 1561
when i try to add form to a worklet
<?php
class WDealStatus extends UWidgetWorklet
{
public $deal;
public function accessRules()
{
return array(array('allow','users'=>array('*')));
}
public function taskConfig()
{
if(!$this->deal && isset($_GET['id']))
$this->deal = MDeal::model()->findByPk($_GET['id']);
if(!$this->deal)
return $this->show = 0;
if(app()->request->isAjaxRequest)
$this->layout = false;
}
public function taskRenderOutput()
{
if(!app()->request->isAjaxRequest)
{
cs()->registerScriptFile(cs()->getCoreScriptUrl().'/jui/js/jquery-ui.min.js');
if(!app()->request->isMobile)
{
cs()->registerScriptFile(asma()->publish($this->module->basePath.DS.'js'.DS.'jquery.timers.js'));
cs()->registerScript(__CLASS__.'#'.$this->deal->id,'$("#'.$this->getDOMId().'").uDealStatusPing("'.url('/deal/status',array('id'=>$this->deal->id)).'");');
}
}
switch(wm()->get('deal.helper')->dealStatus($this->deal))
{
case 'active':
$data = array(
'bought' => $this->deal->stats?(int)$this->deal->stats->bought:0,
'required' => (int)$this->deal->purchaseMin
);
$this->render('active',$data);
break;
case 'tipped':
$this->render('tipped',array('bought'=>$this->deal->stats?(int)$this->deal->stats->bought:0));
break;
case 'closed':
$this->render('closed',array('bought'=>$this->deal->stats?(int)$this->deal->stats->bought:0));
$this->render('payback',array('model'=>$model));# <= this is the code generating the problem
break;
}
}
}
i assume that i am using objects outside of a the form class
how to include it ?