2010-01-23 56 views

回答

1

試着在你看來,這裏的登錄按鈕是

<?php echo CHtml::ajaxButton('Add Course', array('student_Courses/Create'),array(
     'type'=>'POST', 
     'update'=>'#resultStudentCourse', 
     'beforeSend' => 'function(){ 
      $("#resultStudentCourse").addClass("loading"); 
     }', 
     'complete' => 'function(){ 
      $("#resultStudentCourse").removeClass("loading"); 
      }', 

)); ?> 

#resultStudentCourse是你需要在你的消息,例如加載DIV的ID以下。成功登錄

然後在你的控制器創建方法有這樣的事情

if(Yii::app()->request->isAjaxRequest){ 
$this->renderPatial('create',array('model'=>$model)); 
} 

希望這有助於

0
if(Yii::app()->request->isAjaxRequest){ 
$this->renderPatial('create',array('model'=>$model)); 
} 

對於真正清楚起見(因爲沒有太多的人正在使用這個框架還挺)上面應該是

$this->renderPartial 
相關問題