title = 'Utilisateurs'; $this->params['breadcrumbs'][] = $this->title; ?>

title) ?> 'btn btn-primary']) ?> Liste des emails', ['mail'], ['class' => 'btn btn-default']) ?>

$dataProvider, 'columns' => [ 'nom', 'prenom', 'telephone', 'email', [ 'attribute' => 'credit', 'format' => 'raw', 'value' => function($model) use($etablissement) { $html = '
'.Html::a( ' Crédit', Yii::$app->urlManager->createUrl(['user/credit','id' => $model['id']]), [ 'title' => 'Crédit', 'class' => 'btn btn-default' ] ).'
' ; return $html ; } ], [ 'class' => 'yii\grid\ActionColumn', 'template' => '{update}', 'headerOptions' => ['class' => 'actions'], 'buttons' => [ 'update' => function ($url, $model) { $url = Yii::$app->urlManager->createUrl(['user/update','id' => $model['id']]) ; $user = User::find()->with('userEtablissement')->where(['id' => $model['id']])->one() ; if(count($user->userEtablissement) <= 1) { return Html::a(' Modifier', $url, [ 'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' ]); } else { return ' Non modifiable' ; } }, ], ], ], ]); ?>