/** * Cria um período de férias na tabela 'ferias' * @param integer $id - opcional: indica a pessoa que vai tirar férias */ public function actionCreateFerias($id = null) { $model = new Ferias(); if ($id != null) { $model->cod_pessoa = $id; } if (isset($_POST['Ferias'])) { $model->attributes = $_POST['Ferias']; if ($model->validate()) { // form inputs are valid, do something here if ($model->save()) { $this->redirect(array('index')); } return; } } $this->render('_ferias', array('model' => $model)); }