-2
yii「asDialog」中這個函數的含義是什麼。我試圖谷歌,但無法找到任何地方。另外我在代碼中看到了這個控制器中特定動作的對話框。任何人都可以解釋這個函數的含義嗎?Yii中控制器動作的對話框
public function actionCreate()
{
$model=new Vegetable;
if (Yii::app()->request->isAjaxRequest)
{
$this->renderPartial('create', array('model'=>$model, 'asDialog'=>!empty($_GET['asDialog']),), false, true);
Yii::app()->user->setReturnUrl($_GET['returnUrl']);
Yii::app()->end();
}
else
{
if(isset($_POST['Vegetable']))
{
$model->attributes=$_POST['Vegetable'];
$model->image=CUploadedFile::getInstance($model,'image');
$model->image=CUploadedFile::$model->image;
if($model->save())
{
echo "hi";
//$model->image->saveAs(Yii::app()->baseUrl.'/images/vegetables/').$model->image);
$model->image->saveAs(Yii::app()->request->baseUrl.'/images/carausel/'.$model->image);
//$this->redirect(Yii::app()->user->returnUrl);
}
$this->render('create', array('model'=>$model));
}
}
}
你在哪看到這個功能?在一些文檔中?或在某人的代碼? –
我在代碼中看到它。我將粘貼它.. – user2492854
請看看renderii –