Skip to content
Snippets Groups Projects
Select Git revision
  • e2f03018870240b805f82edcea278ba77a2ff946
  • main default protected
  • v0.10
  • 0.10.6
  • 0.10.5
  • 0.10.4
  • 0.10.3
  • 0.10.2
  • 0.10.1
  • 0.10.0
  • 0.9.1
  • 0.9.0
12 results

HooksTraitTest.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'] );
    	}
    }