Vegas CMF Form Elements

Vegas\Forms\Element\Select

Phalcon framework Select element extended with additional addOptions method that allows to add multiple options at once when providing just one array. Added options are merged with those already set.

Configuration

namespace Foo\Forms;

use Vegas\Forms\Element\Select;

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

        // ...
    }
}