フォームを含むポートレットがあります。今、私が達成したいのは次のとおりです。
1)フォームを含むPorletは、ページ内で
<?php $this->widget('form'); ?>
2)ユーザーがこのフォームに入力し、送信をクリックします。「送信ボタンはajaxボタンである必要があります」3)送信が押されたら、フォームはフォームポートレットクラス内のメソッドを呼び出し、フォームはThankyouに置き換えられます。メッセージ。4)ポートレットの現在のビューのみを別のビューに置き換えたい。
私のポートレットクラスは次のようになります
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');
}
}
}