Skip to content
Snippets Groups Projects
Select Git revision
  • 4af284cd0c9ffb5f3c00569553761ae75c3e77ae
  • master default protected
  • devel
  • feature/add-escaping-to-templates
  • feature/add-priority-sorting
  • 3.3.0
  • 3.2.1
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.4.12
  • 2.4.11
  • 2.4.10
  • 2.4.9
  • 2.4.8
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.2
  • 2.3.1
  • 2.3
25 results

SelectField.php

Blame
  • SelectField.php 496 B
    <?php
    
    namespace WPDesk\Forms\Field;
    
    use WPDesk\Forms\Field;
    
    class SelectField extends BasicField {
    
    	public function get_type(): string {
    		return 'select';
    	}
    
    	public function get_template_name(): string {
    		return 'select';
    	}
    
    	/** @param string[] $options */
    	public function set_options( array $options ): self {
    		$this->meta['possible_values'] = $options;
    
    		return $this;
    	}
    
    	public function set_multiple(): self {
    		$this->attributes['multiple'] = 'multiple';
    
    		return $this;
    	}
    }