public function actionCreate() { $model = new Contratotipo(); if (isset($_POST['Contratotipo'])) { $model->setAttributes($_POST['Contratotipo']); $model->nombre = strtoupper($model->nombre); try { if ($model->save()) { $this->setFlash('notice', array('title' => 'Mensaje', 'content' => 'Se grabó correctamente.')); $this->redirect(array('manage')); } } catch (Exception $e) { $model->addError('', $e->getMessage()); } } elseif (isset($_GET['Contratotipo'])) { $model->attributes = $_GET['Contratotipo']; } $this->render('create', array('model' => $model)); }