Problem with Ajax Validation

Hello guys,

I’m trying to make unique mobile number on registration.

So, I’m using Ajax validation. But I got blank page when I click on button save.

Can you help me :)

Model:

public function rules()

{


    return [


        [['clicnic_idclicnic'], 'required'],


        [['clicnic_idclicnic','day','month','year'], 'integer'],


        [['birthday', 'first_login_date', 'last_login_date'], 'safe'],


        [['first_name', 'last_name', 'street', 'plc', 'city', 'phone', 'mobile', 'email'], 'string', 'max' => 45],


        [['mobile'],'unique'],





    ];


}

View

<?php $form = ActiveForm::begin([

    'enableAjaxValidation'=&gt;true,


]); ?&gt;

<?= $form->field($model, ‘mobile’)->textInput([‘maxlength’ => true]) ?>

Controller

public function actionCreate()

{


    &#036;model = new Patient();








    if(Yii::&#036;app-&gt;request-&gt;isAjax &amp;&amp; &#036;model-&gt;load(Yii::&#036;app-&gt;request-&gt;post())){


        Yii::&#036;app-&gt;response-&gt;format = 'json';


        return ActiveForm::validate(&#036;model);


    }


    &#036;year[] = null;


    for (&#036;i=1950; &#036;i &lt;= date(&quot;Y&quot;); &#036;i++) { 


        &#036;year[&#036;i] = &#036;i;


    }


    &#036;day[] = null;


    for (&#036;i=1; &#036;i &lt;= 31; &#036;i++) { 


        &#036;day[&#036;i] = &#036;i;


    }


    &#036;month[] = null;


    for (&#036;i=1; &#036;i &lt;= 12; &#036;i++) { 


        &#036;month[&#036;i] = &#036;i;


    }


    if (&#036;model-&gt;load(Yii::&#036;app-&gt;request-&gt;post()) ) {


        &#036;model-&gt;birthday = &#036;model-&gt;year.'-'.&#036;model-&gt;month.'-'.&#036;model-&gt;day;


        if (&#036;model-&gt;save()) {


            return &#036;this-&gt;redirect(['appointment/index','phonenum'=&gt;&#036;model-&gt;mobile]);


        }


    } else {


        return &#036;this-&gt;render('create', [


            'model' =&gt; &#036;model,


            'clinic' =&gt; Clinic::find()-&gt;all(),


            'day' =&gt; &#036;day,


            'month' =&gt; &#036;month,


            'year' =&gt; &#036;year,


        ]);


    }


}