/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'update' page. */ public function actionCreate() { $this->breadcrumbs = array('Яндекс метки' => array('/yandexmap/yandexmap'), 'Новая запись'); $model = new YandexMap(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); // set attributes from get if (isset($_GET['YandexMap'])) { $model->attributes = $_GET['YandexMap']; } if (isset($_POST['YandexMap'])) { $model->attributes = $_POST['YandexMap']; if ($model->save()) { $url = isset($_POST['go_to_list']) ? $this->listUrl('index') : $this->itemUrl('update', $model->id); $this->redirect($url); } } $this->render('create', array('model' => $model)); }