2017 © Pedro Peláez
 

yii2-extension yii2-toggle-column

Yii2 Extenstion for set seo attributes

image

porcelanosa/yii2-toggle-column

Yii2 Extenstion for set seo attributes

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Toggle Column component

Installation

composer require porcelanosa/yii2-toggle-column

Usage

In controller file add action, (*1)


use porcelanosa\yii2togglecolumn\ToggleAction; use app\models\Artists; class ArtistsController extends Controller { //............. public function actions() { return [ 'toggle' => [ 'class' => ToggleAction::className(), 'modelClass' => Artists::className(), // Uncomment to enable flash messages //'setFlash' => true, 'attribute' => 'active', 'primaryKey' => 'id' ], ] } //....... }

I view file add column to the GridView, (*2)

 = GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        *['class' => 'yii\grid\SerialColumn'],

        'id',
        [
            'class' => 'app\modules\admin\components\columns\ToggleColumn',
            'attribute' => 'active',
            // Uncomment if  you don't want AJAX
            'enableAjax' => true,
            'contentOptions' => ['style' => 'width:50px;']
        ],
        ['class' => ActionColumn::className()],
    ],
    ]); ?>

Screenshot, (*3)

The Versions

18/07 2016

dev-master

9999999-dev https://github.com/porcelanosa/yii2-toggle-column

Yii2 Extenstion for set seo attributes

  Sources   Download

MIT

The Requires

 

by Alex Porcelanosa

yii2 yii yii 2 gridview gridview column