PHP code example of pillum / yii2-dual-list-view

1. Go to this page and download the library: Download pillum/yii2-dual-list-view 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/ */

    

pillum / yii2-dual-list-view example snippets



echo pillum\duallistview\Widget::widget([
    'model' => $model,
    'attribute' => 'list_regions',
    'title' => 'города',
    'data' => $region,
    'data_id'=> 'id',
    'data_value'=> 'name',
    'data_value_extended'=> 'name_extended',
    'lngOptions' => [
        'warning_info' => 'Вы уверены, что хотите выбрать такое количество элементов?
                           Возможно Ваш браузер может перестанет отвечать на запросы..',
        'search_placeholder' => 'Фильтр',
        'showing' => ' - показано',
        'available' => 'Имеющиеся',
        'selected' => 'Выбранные'
    ]
  ]);

        $model = new ModelForm;
        
        $region = Region::find();

$model = new ModelForm;
$model->load(Yii::$app->request->post());
$region_model = Json::decode($model->list_regions);