# shiftcontroller/4.9.85/hc3/ui/element/input/button.php

ShiftController Employee Shift Scheduling, version 4.9.85. 27 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/hc3/ui/element/input/button.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/raw/hc3/ui/element/input/button.php
- Modified: 2023-05-29T12:46:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/hc3/ui/element/input/button.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
class HC3_Ui_Element_Input_Button extends HC3_Ui_Abstract_Input
{
	protected $el = 'input';
	protected $uiType = 'input/button';
	public $label, $alt, $name;

	public function __construct( $label, $name = null, $alt = null )
	{
		$this->label = $label;
		$this->alt = ( (null !== $alt) && strlen($alt) ) ? $alt : $label; 
		$this->name = $name;
	}

	public function render()
	{
		$this
			->addAttr('type', 'button' )
			->addAttr('name', $this->htmlName() )
			->addAttr('title', $this->alt )
			->addAttr('value', $this->label )
			;

		$out = parent::render();
		return $out;
	}
}
```
