PHP code example of antonyz89 / yii2-toggle-column

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

    

antonyz89 / yii2-toggle-column example snippets


use antonyz89\togglecolumn\Module as ToggleColumnModule;
use yii\i18n\PhpMessageSource;

return [
    // ...
    'modules' => [
        'toggle-column' => [
            'class' => ToggleColumnModule::class,
        ],
    ],
    'i18n' => [
        'translations' => [
            'tc' => [ // Toggle Column
                'class' => PhpMessageSource::class,
                'basePath' => '@antonyz89/togglecolumn/messages',
            ],
        ],
    ],
    // ...
];



$columns = [
    'code',
    [
        'attribute' => 'partner_id',
        'value' => 'partner',
        'visible' => false // will not be displayed in ToggleColumn widget either
    ],
    [
        'attribute' => 'customer',
    ],
    [
        'attribute' => 'status',
        'value' => 'statusAsText'
    ],
];