PHP code example of pozitronik / yii2-grid-helper-asset

1. Go to this page and download the library: Download pozitronik/yii2-grid-helper-asset library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pozitronik / yii2-grid-helper-asset example snippets




/**
 * @var View $this
 * ...
 */
...
use yii\web\View;
use app\assets\GridHelperAsset;
use yii\helpers\Html;
use yii\web\JsExpression;
/*preferred usage with kartik grid, but it should work with default grid too*/
use kartik\grid\GridView;
...
/*register asset in your view*/
GridHelperAsset::register($this);
$id = 'name-for-your-grid';