PHP code example of kotchuprik / yii2-sortable-widgets
1. Go to this page and download the library: Download kotchuprik/yii2-sortable-widgets 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/ */
kotchuprik / yii2-sortable-widgets example snippets
class m140811_131705_Models_order extends \kotchuprik\sortable\migrations\Migration
{
protected $tableName = 'models';
}
public function behaviors()
{
return [
'sortable' => [
'class' => \kotchuprik\sortable\behaviors\Sortable::className(),
'query' => self::find(),
],
];
}
public function actions()
{
return [
'sorting' => [
'class' => \kotchuprik\sortable\actions\Sorting::className(),
'query' => \vendor\namespace\Model::find(),
],
];
}