<commit_before><?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\PostSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Posts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Post', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'titulo',
            'conteudo:ntext',
            [
                'attribute' => 'userId',
                'header' => 'Username',
                'value'=> 'user.userName' //valor vem direto do models/User
            ],
            [
                'attribute' => 'fullname',
                'header' => 'Full Name',
                'value'=> 'user.FullName' //valor vem direto do models/User
            ], <commit_msg>changing header to label propertie to allow ordering in the gridview<commit_after><?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\PostSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Posts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Post', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'titulo',
            'conteudo:ntext',
            [
                'enableSorting' => TRUE,
                'attribute' => 'userId',
                'label' => 'Username',
                'value'=> 'user.userName' //valor vem direto do models/User
            ],
            [
                'enableSorting' => TRUE,
                'attribute' => 'fullname',
                'label' => 'Full Name',
                'value'=> 'user.FullName' //valor vem direto do models/User
            ], 
{'fraction_non_alphanumeric': 0.19436504695794202, 'fraction_numerical': 0.0016333197223356473, 'mean_word_length': 1.9841656516443362, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2931654', 'n_tokens_mistral': 773, 'n_tokens_neox': 759, 'n_words': 154}