В моем веб-приложении мне нужно создать кнопку iframe, используя quickdlgs для создания новых записей. Но когда я нажимаю кнопку я frame, я не получаю веб-страницу "create", но я получаю пустой Iframe. Мое действиеСоздать код для контроллера
public function actionCreate()
{
$model=new Store;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Store']))
{
$model->attributes=$_POST['Store'];
if($model->save())
{
EQuickDlgs::checkDialogJsScript();
$this->redirect(array('admin'));
}
$this->redirect(array('view','id'=>$model->id));
EQuickDlgs::render('create',array('model'=>$model));
// $this->redirect(array('create'));
}
}
Мой код просмотра для iframe
<?php
EQuickDlgs::iframeButton(
array(
//'id' =>'create',
// 'renderOpenButton' => false,
'controllerRoute' => 'create',
//'url' =>'/store/create',
'dialogTitle' => 'Create Store',
'dialogWidth' => 500,
'dialogHeight' => 500,
'openButtonText' => 'Create new',
'closeButtonText' => 'Close',
//'closeOnAction' => true, //important to invoke the close action in the actionCreate
'refreshGridId' => 'store-grid', //the grid with this id will be refreshed after closing
)
);
?>
Этот код я написал на странице просмотра admin.php. Но когда я нажимаю кнопку iframe, я получаю пустой iframe вместо кнопки create. Любое тело любезно поможет мне в этом.
Строка EQuickDlgs::render('create',array('model'=>$model));
должен быть вне сферы действия if
.