Posts

Showing posts with the label yii2-advanced-app

Yii2 - How to Hide and Show Div Class using Dropdownlist

Image
Clash Royale CLAN TAG #URR8PPP Yii2 - How to Hide and Show Div Class using Dropdownlist I have this form as show below When study centre Dropdownlist is onchange, when no value is selected, the search criteria should hide. But when a value is selected, is should show. The search criteria should hide by default. Controller public function actionIndex() { $model = new Programme(); $model->scenario = 'import-programme'; return $this->render('index', [ 'model' => $model, ]); } <?php $form = ActiveForm::begin([ 'id' => 'import-programme', 'enableAjaxValidation' => false, 'options' => ['enctype' => 'multipart/form-data'], ]); ?> View <div class="box-info box box-solid view-item col-xs-12 col-lg-12 no-padding"> <div class="box-header with-border"> <h3 class="box-title"><i class="fa fa-search"></i>...

Yii2 machour NotificationsWidget class not found

Image
Clash Royale CLAN TAG #URR8PPP Yii2 machour NotificationsWidget class not found We are trying to run "machour" notification widget in Yii2-Advanced template. We could successfully install the extension through composer. We are getting the following class error: Class 'NotificationsWidget' not found. The above problem is still existing Yii2 notification widget class not found. We are calling following code in layouts folder: use commonmodelsNotification; <?php NotificationsWidget::widget([ 'theme' => NotificationsWidget::THEME_GROWL, 'clientOptions' => [ 'location' => 'br', ], 'counters' => [ '.notifications-header-count', '.notifications-icon-count' ], 'markAllSeenSelector' => '#notification-seen-all', 'listSelector' => '#notifications', ]); ?> And this is...

how to retrieve data from database through ajax against specific id in yii2 framwork

Image
Clash Royale CLAN TAG #URR8PPP how to retrieve data from database through ajax against specific id in yii2 framwork _form.php <?= $form->field($vehicle, 'vehicleRegistrationNumber')->textInput(['maxlength' => true, 'id'=> 'regNum']) ?> Ajax code $.ajax({ type:'POST', cache:false, data:{regNum:regNum}, url: "<?php echo Url::toRoute('appointments/regAjax.php')?>", succes: function(response){ console.log('success'); } }); AppointmentsController public function actionRegAjax() { if(Yii::$app->request->isAjax){ $data= Yii::$app->request->post(); } } regAjax.php <?php $regNum = $_POST['regNum']; echo json_encode($regNum); ?> By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie ...