public function actionAddOperationNameRule() { $errors = array(); $rule = new OphTrOperationbooking_Operation_Name_Rule(); if (!empty($_POST)) { $rule->attributes = $_POST['OphTrOperationbooking_Operation_Name_Rule']; if (!$rule->save()) { $errors = $rule->getErrors(); } else { Audit::add('admin', 'create', $rule->id, null, array('module' => 'OphTrOperationbooking', 'model' => 'OphTrOperationbooking_Operation_Name_Rule')); $this->redirect(array('/OphTrOperationbooking/admin/viewOperationNameRules')); } } $this->render('/admin/editoperationnamerule', array('rule' => $rule, 'errors' => $errors)); }