PHP code example of ereminmdev / yii2-sortablejs

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

    

ereminmdev / yii2-sortablejs example snippets


<?= \ereminmdev\yii2\sortablejs\SortableJs::widget([
    'elementSelector' => '.items',
    'clientOptions' => [
        'handle' => '.item-handle',
    ],
]) 

public function actions()
{
    return [
        'sortable' => [
            'class' => 'ereminmdev\yii2\sortablejs\SortableJsAction',
        ],
    ];
}

$this->registerJs('if (Sortable.active) Sortable.active.destroy();');