Create a select month field.

@param  string  $name
@param  string  $selected
@param  array   $options

@return string
553374
public function selectMonth($name, $selected = null, $options = [], $format = '')
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::selectMonth($name, $selected, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }
769911
public function select($name, array $list = [], $selected = null, array $options = [])
    {
        return $this->form->select($name,
                                   $list,
                                   $selected,
                                   $this->addFormControlClass($this->getFieldOptions($name, $options)));
    }
325278
public function make($name, $options = [])
    {
        if (!$name || !$this->exists($name)) {
            return null;
        }

        return $name($options);
    }
73797
public function plainSelect($name, $list = array(), $selected = null, $options = array())
    {
        return parent::select($name, $list, $selected, $options);
    }
1164448
protected function getFieldId($name, array $options = [])
    {
        if (Arr::has($options, 'field.id')) {
            return Arr::get($options, 'field.id');
        }

        return 'field-' . str_replace('_', '-', $name);
    }
1178780
public function month($name, $value = null, $options = array())
    {        
		return $this->input('month', $name, $value, $options);
    }
948642
public function addFilterSelect($key, $name, array $options, $column = null)
	{
		$column = $column ?: $key;

		if (!is_string($column)) {
			throw new DataGridException('Filter Select can only filter in one column.');
		}

		$this->addFilterCheck($key);

		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
	}
486888
protected function createCheckbox($name, $options)
    {
        $box = new Checkbox($name, $options);
        $box->setAttribute('checked', true)
            ->setAttribute(
                'id',
                preg_replace(
                    array('~\[~', '~\]~', '~--+~', '~-$~'),
                    array('-', '', '-', ''),
                    $name
                )
            );

        return $box;
    }
442372
public static function selectOptions($optionsArray, $selected = NULL) {
    $ret = array();
    foreach ($optionsArray as $value => $label) {
      if ($label instanceof HTMLTag) {
        $tag = $label;
        
        if ($tag->getAttribute('value') === $selected)
          $tag->setAttribute('selected','selected');

      } else {
        /* Interface Form Item */
        if($label instanceof \Psc\Form\Item) {
          $item = $label;
          $label = $item->getFormLabel();
          $value = $item->getFormValue();
        }
        
        $tag = static::tag('option',self::esc((string) $label),array('value'=>$value));
        if ($value === $selected)
          $tag->setAttribute('selected','selected');
      }
      
      $ret[] = $tag;
    }
    return $ret;
  }
22265
public function createOptions(array $options, $selected = null)
    {
        foreach ($options as $label => $value) {
            $option = $this->createOption($label, $value);

            if (is_array($selected) && in_array($value, $selected)) {
                $option->selected();
            } elseif ($selected === $value) {
                $option->selected();
            }
        }

        return $this;
    }
833925
public function multiselect($name = null, $options = [], $value = null)
    {
        return Select::create()
            ->attributeIf($name, 'name', $this->fieldName($name))
            ->attributeIf($name, 'id', $this->fieldName($name))
            ->options($options)
            ->value($name ? $this->old($name, $value) : $value)
            ->multiple();
    }
603238
public function selectTag($name, $options, array $attrs = [])
    {
        # This is found also in Form::select()
        if (!is_string($options)) {
            if (is_array($options) && ArrayTools::isIndexed($options) && count($options) == 2)
                list ($options, $value) = $options;
            else
                $value = null;
            $options = $this->optionsForSelect($options, $value);
        }
        
        if (isset($attrs['prompt'])) {
            $options = $this->contentTag('option', $attrs['prompt'], ['value' => '', 'allow_blank_attrs' => true]) . "\n" . $options;
            unset($attrs['prompt']);
        }
        $attrs['value'] = $attrs['type'] = null;
        
        $select_tag = $this->_form_field_tag('select', $name, $options, $attrs, true);
        return $select_tag;
    }
1157476
public function select($name, $list = array(), $selected = null, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::select($name, $list, $selected, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }
323149
public function getForm(string $name = null, array $options = []): Form
    {
        $name               = $name ?? $this->form ?? $this->serviceAlias;
        $sl                 = $this->getServiceLocator();
        $formElementManager = $sl->get('FormElementManager');
        $argv               = compact('options');
        $argv               = $this->prepareEventArguments($argv);

        $this->getEventManager()->trigger(self::EVENT_PRE_FORM_INIT, $this, $argv);

        /* @var $form Form */
        $form = $formElementManager->get($name, $options);
        $argv = compact('form', 'options');
        $argv = $this->prepareEventArguments($argv);

        $this->getEventManager()->trigger(self::EVENT_POST_FORM_INIT, $this, $argv);

        return $form;
    }
1272102
public function checkbox(string $name, array $options = []): FieldTypeInterface
    {
        return (new CheckboxType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
986326
public function select($name, array $options, $selected = null, array $attributes = [])
    {
        $tag = new Tag('select', $attributes);
        $tag->name = $name;
        
        if ($selected === null)
            $selected = $this->getDefaultValue($name);

        foreach ($options as $value => $label)
        {
            $option = new Tag('option');
            $option->value = $value;
            $option->setText($label);

            if ($selected !== null && $value == $selected)
                $option->selected = true;

            $tag->addChild($option);
        }

        return $tag;
    }
370445
public function selectCollection($name, array $options = [])
    {
        if (!isset($this->collections[$name])) {
            $this->createCollection($name);
        }
        return $this->collections[$name]['collection'];
    }