1. Go to this page and download the library: Download isavon/yii2-sortablegrid 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/ */
isavon / yii2-sortablegrid example snippets
public function actions()
{
return [
SortableGridAction::SORTABLE_ACTION => [
'class' => SortableGridAction::className(),
'modelName' => Model::className(),
],
];
}
public function behaviors()
{
return [
[
'class' => SortableGridBehavior::className(),
'sortableAttribute' => 'sortOrder',
],
];
}