PHP code example of mmonem / yii2-gridview2

1. Go to this page and download the library: Download mmonem/yii2-gridview2 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/ */

    

mmonem / yii2-gridview2 example snippets


    'editColumns' => [
        'column_1',
         ['attr' =>'column_2', 'select' => [1 => 'Name 1', 2 => 'Name 2']],
        'column_3',
    ],
   'createUrl' => Url::to(['some-controller/createajax']),
    

        public function actions()
        {
            return [
                'createajax' => [
                    'class' => 'mmonem\yii2gridview2\CreateAction',
                    'modelClass' => SomeModel::className()
                ],
            ];
        }