<commit_before><?php
namespace frontend\ext\Grid;

use backend\ext\System\BPjax;
use yii\base\Widget;
use yii\db\ActiveRecord;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;

class FGridPjaxWidget extends Widget
{
    const GRID_JS_ID = 'mainGridId';
    protected $gridConfig;

    function __construct(ActiveRecord $searchModel, $dataProvider, $columns, $filterUrl = null, $gridConfig = [])
    {

        $customConfig = [
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'columns' => $columns,

            //'layout' => '{pager}{items}{pager}',
            'layout' => '{pager}<div class="spacer"></div>{items}',
            //see GridView default classes
            'tableOptions' => ['class' => 'table table-striped table-bordered table-condensed'],
            'id' => self::GRID_JS_ID
        ];

        if (!is_null($filterUrl)) {
            $customConfig['filterUrl'] = $filterUrl;
        }

        $this->gridConfig = ArrayHelper::merge($customConfig, $gridConfig);
    }

    public function run()
    {
        parent::run();

        BPjax::begin();

        echo GridView::widget($this->gridConfig);

        BPjax::end();

    }

}
<commit_msg>customm html for grid<commit_after><?php
namespace frontend\ext\Grid;

use backend\ext\System\BPjax;
use yii\base\Widget;
use yii\db\ActiveRecord;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;

class FGridPjaxWidget extends Widget
{
    const GRID_JS_ID = 'mainGridId';
    protected $gridConfig;

    public $customHtml;

    function __construct(ActiveRecord $searchModel, $dataProvider, $columns, $filterUrl = null, $gridConfig = [])
    {
        $customConfig = [
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'columns' => $columns,

            //'layout' => '{pager}{items}{pager}',
            'layout' => '{pager}<div class="spacer"></div>{items}',
            //see GridView default classes
            'tableOptions' => ['class' => 'table table-striped table-bordered table-condensed'],
            'id' => self::GRID_JS_ID
        ];

        if (!is_null($filterUrl)) {
            $customConfig['filterUrl'] = $filterUrl;
        }

        $this->gridConfig = ArrayHelper::merge($customConfig, $gridConfig);
    }

    public function run()
    {
        parent::run();

        BPjax::begin();

        if (!empty($this->customHtml)) {
            echo $this->customHtml;
        }

        echo GridView::widget($this->gridConfig);

        BPjax::end();

    }

}

{'fraction_non_alphanumeric': 0.15054602184087362, 'fraction_numerical': 0.0, 'mean_word_length': 2.508891928864569, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, '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': '1350724', 'n_tokens_mistral': 789, 'n_tokens_neox': 769, 'n_words': 147}