Vegas CMF Form Elements

Vegas\Forms\Element\MultiSelect

Extended Select element, with possiblity of selecting multiple values. Visual part is provided by jquery.multiselect.js - drop-in replacement for the standard <select>.

All required js and css files are included in vegas library. Check installation guide for more details.

Configuration

namespace Foo\Forms;

use Vegas\Forms\Element\MultiSelect;

class Bar extends \Vegas\Forms\Form
{
    public function initialize()
    {
        $roles = new MultiSelect('roles');
        $roles->setAssetsManager($this->assets);
        $roles->addOptions([
            'key1' => 'value1',
            'key2' => 'value2'
        ]);
        $this->add($roles);

        // ....
    }
}