/** * Lists all Deductions models. * @return mixed */ public function actionIndex() { $username=Yii::$app->user->identity->username; $users = User::find()->all(); $scholars = Scholars::find()->all(); $model = new Deductions(); foreach($users as $user){ foreach($scholars as $scholar){ if($user->username==$username&&$user->id==$scholar->scholar_id){ $model->deduction_scholar_id=$scholar->scholar_id; $searchModel = new DeductionsSearch($model); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } } } }
], ]; echo TabsX::widget([ 'items'=>$items, 'position'=>TabsX::POS_ABOVE, 'encodeLabels'=>false, ]); ?> <?php ob_start(); $model = new Deductions(); $searchModel = new DeductionsSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); echo $this->render('/deductions/index',[ 'model'=>$model, 'dataProvider'=>$dataProvider, 'searchModel' =>$searchModel, ]); $TabContent=ob_get_clean(); ?> <?php $items2 = [ [ 'label'=>'<i class="glyphicon glyphicon-thumbs-down"></i> Deductions', 'content'=>$TabContent