Exemplo n.º 1
0
 /**
  * Performs the AJAX validation.
  * @param CModel $model the model to be validated
  * @param string $form the name of the form
  */
 protected function performAjaxValidation($model, $form)
 {
     if (Yii::app()->request->isAjaxRequest && $_POST['ajax'] == $form) {
         echo GxActiveForm::validate($model);
         Yii::app()->end();
     }
 }
 /**
  * Performs the AJAX validation.
  * #MethodTracker
  * This method is based on the gii generated method controller::performAjaxValidation, from version 1.1.7 (r3135). Changes:
  * <ul>
  * <li>Supports multiple models.</li>
  * </ul>
  * @param CModel|array $model The model or array of models to be validated.
  * @param string $form The name of the form. Optional.
  */
 protected function performAjaxValidation($model, $form = null)
 {
     if (Yii::app()->getRequest()->getIsAjaxRequest() && ($form === null || $_POST['ajax'] == $form)) {
         echo GxActiveForm::validate($model);
         Yii::app()->end();
     }
 }
Exemplo n.º 3
0
 protected function performAjaxValidationTabular($model, $form = null)
 {
     if (Yii::app()->getRequest()->getIsAjaxRequest() && ($form === null || isset($_POST['ajax']) && parent::startsWith($_POST['ajax'], $form))) {
         echo GxActiveForm::validateMultiple($model);
         Yii::app()->end();
     }
 }