Exemplo n.º 1
0
?>

<div style="margin-bottom: 5px">
    <table width="100%">
        <tbody>
            <tr>  
                <td>
                    <span class="pg-title">Utilizadores</span>
                </td>
                <td>     
                    <?php 
echo Html::a('Adicionar', ['create'], ['class' => 'btn btn-success pull-right']);
?>
   
                </td>
            </tr>
        </tbody>
    </table>
</div>

<div class="User-default-index">
   
   <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $search, 'layout' => '{items}{pager}', 'columns' => ['id', 'username', ['attribute' => 'profile_id', 'format' => 'text', 'content' => function ($data) {
    return $data->profile->name;
}], ['attribute' => 'status', 'format' => 'text', 'content' => function ($data) {
    return \common\enum\UserStatus::toName($data->status);
}], 'email', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>
    
</div>