Hi, I need to send errors to the user, an those errors are more like "business" or Logic errors.
I created a Cform based class, and interact with the user, everything works fine, with error based on "rules".
But I need some other errors:
like :
"The period (year and month) you select is allready taken…"
or
"Please especify one range condition"
I mean there are some logic errors.
What Objetc::method should be executed from the controller ?
public function actionGenerate() {
$model = new GeneraCuotaForm;
$anios = CuotaDefAnual::model()->getAniosActivos();
/*
*/
//$anios = $anios ;
if (isset($_POST['GeneraCuotaForm'])) {
//echo print_r($_POST['GeneraCuotaForm']['anio']);
//echo print_r($_POST['GeneraCuotaForm']);
$model->setAttributes($_POST['GeneraCuotaForm']);
//*** Validations ***
/*if ($model->save()) {
if (Yii::app()->getRequest()->getIsAjaxRequest())
Yii::app()->end();
else
$this->redirect(array('view', 'id' => $model->id));
}*/
}
$this->render('generacuota', array( 'model' => $model, 'anios' => $anios));
}
I couldn’t find any answer on tutorials.
Best Regards