我有一个包含表单的 Portlet。现在我想要实现的是以下。
1) 包含表单的 Porlet 在页面内通过以下方式调用
<?php $this->widget('form'); ?>
2) 用户填写此表单并单击提交“提交按钮应该是一个 ajax 按钮” 3) 当提交被按下时,表单应该调用表单 portlet 类中的方法,并且表单应该替换为谢谢信息。4) 我只想用另一个视图替换 portlet 中的当前视图。
我的 portlet 类看起来像这样
Yii::import('zii.widgets.CPortlet');
class Polls extends CPortlet{
public $usr_id='';
public function init(){
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
parent::init();
}
protected function renderContent(){
$this->render('form');
}
public function update(){
$this->render('thankyou');
}
}
}