switch ($component) { case "toggle": $toggle = new Toggle(); break; case "toggle-on-focus": $toggle = new ToggleOnFocus(); break; case "toggle-on-pressed": $toggle = new ToggleOnPress(); break; case "toggle-off-focus": $toggle = new ToggleOffFocus(); break; case "toggle-off-pressed": $toggle = new ToggleOffPress(); break; case "toggle-disabled": $toggle = new ToggleOnDisabled(); break; case "toggle-disabled-focus": $toggle = new ToggleOnDisabledFocus(); break; case "toggle-off-disabled-focus": $toggle = new ToggleOffDisabledFocus(); break; default: $toggle = new Toggle(); break; } $toggle->generate_image($color, $size, $holo, $kitkat); }
/** * @param string $name * @param array $attributes * @param mixed $value * * @since 2.0 */ public function __construct($name = '', array $attributes = [], $value = null) { $attributes['type'] = 'radio'; parent::__construct($name, $attributes, $value); }
function NthToggle($startState, $max) { Toggle::Toggle($startState); $this->_countMax = $max; $this->_count = 0; }
/** * _shortcode * * @param array $attributes given * * @return void generated content */ public static function _shortcode($attributes) { return Toggle::show($attributes['click'], $attributes['toggle']); }