Skip to content
Snippets Groups Projects
Select Git revision
  • 6ac4e60b71289c212d1cf80e22c5c2b500d16e5b
  • master default protected
  • 1.1.0
  • 1.0
4 results

TestGetStrategy.php

Blame
  • CheckboxField.php 583 B
    <?php
    
    namespace WPDesk\Forms\Field;
    
    use WPDesk\Forms\Field;
    
    class CheckboxField extends BasicField {
    
    	const VALUE_TRUE  = 'yes';
    	const VALUE_FALSE = 'no';
    
    	public function get_type(): string {
    		return 'checkbox';
    	}
    
    	public function get_template_name(): string {
    		return 'input-checkbox';
    	}
    
    	public function get_sublabel(): string {
    		return $this->meta['sublabel'];
    	}
    
    	public function set_sublabel( string $value ): Field {
    		$this->meta['sublabel'] = $value;
    
    		return $this;
    	}
    
    	public function has_sublabel(): bool {
    		return isset( $this->meta['sublabel'] );
    	}
    }