phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlInput.php
Go to the documentation of this file.
1<?php
3
10use Ajax\JsUtils;
11use Ajax\common\html\html5\HtmlInput as HtmlInput5;
14
16
17 public function __construct($identifier, $type = "text", $value = "", $placeholder = "") {
18 parent::__construct("div-" . $identifier, "div", "ui input");
19 $this->_identifier = $identifier;
20 $this->_libraryId = $identifier;
21 $this->content = [
22 "field" => new HtmlInput5($identifier, $type, $value, $placeholder)
23 ];
24 $this->_states = [
25 State::DISABLED,
26 State::FOCUS,
27 State::ERROR
28 ];
29 $this->_variations = [
30 Variation::TRANSPARENT
31 ];
32 }
33
34 public function getField() {
35 return $this;
36 }
37
38 public function getDataField() {
39 return $this->content["field"];
40 }
41
42 public static function outline($identifier, $icon, $value = "", $placeholder = "") {
43 $result = new HtmlInput($identifier, "text", $value, $placeholder);
44 $result->addToProperty("class", "transparent");
45 $result->addIcon($icon)->setOutline();
46 return $result;
47 }
48
49 public function run(JsUtils $js) {
50 $result = parent::run($js);
51 $result->attach("#" . $this->getDataField()
52 ->getIdentifier());
53 return $result;
54 }
55
56 public function setTransparent() {
57 return $this->addToProperty("class", "transparent");
58 }
59
60 public function compile_once(\Ajax\JsUtils $js = NULL, &$view = NULL) {
61 parent::compile_once($js, $view);
62 if (isset($this->content['file'])) {
63 $this->onCreate(Javascript::fileUploadBehavior($this->identifier));
64 }
65 }
66
67 public function addDataList($items) {
68 $dl = new HtmlDatalist('list-' . $this->identifier);
69 $dl->addItems($items);
70 $this->getDataField()->setProperty('list', $dl->getIdentifier());
71 $this->getDataField()->wrap($dl);
72 }
73}
JQuery PHP library.
Definition JsUtils.php:23
Base class for Semantic double elements.
run(JsUtils $js)
{{SimpleExtComponent\Ajax\common\html\BaseHtmlrun()\Ajax\common\html\BaseHtmlrun()}HtmlDoubleElement:...
Definition HtmlInput.php:49
compile_once(\Ajax\JsUtils $js=NULL, &$view=NULL)
{{}\Ajax\common\html\BaseHtmlcompile_once()}
Definition HtmlInput.php:60
__construct($identifier, $type="text", $value="", $placeholder="")
Definition HtmlInput.php:17
static outline($identifier, $icon, $value="", $placeholder="")
Definition HtmlInput.php:42