22 lines
728 B
PHP
22 lines
728 B
PHP
|
|
<?
|
||
|
|
namespace ui\input;
|
||
|
|
|
||
|
|
class Text extends Input {
|
||
|
|
public function render(array $opt = array()): string
|
||
|
|
{
|
||
|
|
|
||
|
|
if(file_exists($file = dirname(__FILE__).'/views/'.$this->theme.'.php')) {
|
||
|
|
ob_start();include($file);return ob_get_clean();
|
||
|
|
} else {
|
||
|
|
return '<div class="form-group form-group-float" data-input="text" data-name="'.$this->name.'" '.$this->getDataInit().'>
|
||
|
|
<label class="form-group-float-label">' . $this->label . '</label>
|
||
|
|
<input type="text" class="form-control" name="' . $this->name . '" placeholder="' . $this->options[Input::PLACEHOLDER] . '" value="' . h($this->value) . '"
|
||
|
|
'.($this->options[Input::DISABLED]?'disabled="disabled"':'').'
|
||
|
|
>
|
||
|
|
</div>';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|