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
2
namespace
Ajax\common\html\html5
;
3
4
use
Ajax\common\html\HtmlSingleElement
;
5
use
Ajax\service\JString
;
6
use
Ajax\JsUtils
;
7
8
class
HtmlInput
extends
HtmlSingleElement
{
9
10
protected
$_placeholder
;
11
12
public
function
__construct
(
$identifier
, $type =
"text"
, $value = NULL, $placeholder = NULL) {
13
parent::__construct(
$identifier
,
"input"
);
14
$this->
setProperty
(
"name"
,
$identifier
);
15
$this->
setValue
($value);
16
$this->
setPlaceholder
($placeholder);
17
$this->
setProperty
(
"type"
, $type);
18
}
19
20
public
function
setValue
($value) {
21
if
(isset($value))
22
$this->
setProperty
(
"value"
, $value);
23
return
$this;
24
}
25
26
public
function
setInputType
($value) {
27
return
$this->
setProperty
(
"type"
, $value);
28
}
29
30
public
function
forceValue
($value =
'true'
) {
31
$this->
wrap
(
'<input type="hidden" value="false" name="'
. $this->identifier .
'"/>'
);
32
$this->
setValue
($value);
33
return
$this;
34
}
35
36
public
function
setPlaceholder
($value) {
37
if
(JString::isNotNull($value))
38
$this->_placeholder = $value;
39
return
$this;
40
}
41
42
public
function
compile
(
JsUtils
$js = NULL, &$view = NULL) {
43
$value =
$this->_placeholder
;
44
if
(JString::isNull($value)) {
45
if
(JString::isNotNull($this->
getProperty
(
"name"
)))
46
$value = \ucfirst($this->
getProperty
(
"name"
));
47
}
48
$this->
setProperty
(
"placeholder"
, $value);
49
return
parent::compile($js, $view);
50
}
51
}
Ajax\JsUtils
JQuery PHP library.
Definition
JsUtils.php:23
Ajax\common\html\BaseHtml\wrap
wrap($before, $after="")
Definition
BaseHtml.php:170
Ajax\common\html\BaseWidget\$identifier
$identifier
Definition
BaseWidget.php:14
Ajax\common\html\HtmlSingleElement
Definition
HtmlSingleElement.php:7
Ajax\common\html\html5\HtmlInput
Definition
HtmlInput.php:8
Ajax\common\html\html5\HtmlInput\$_placeholder
$_placeholder
Definition
HtmlInput.php:10
Ajax\common\html\html5\HtmlInput\__construct
__construct($identifier, $type="text", $value=NULL, $placeholder=NULL)
Definition
HtmlInput.php:12
Ajax\common\html\html5\HtmlInput\setValue
setValue($value)
Definition
HtmlInput.php:20
Ajax\common\html\html5\HtmlInput\compile
compile(JsUtils $js=NULL, &$view=NULL)
Definition
HtmlInput.php:42
Ajax\common\html\html5\HtmlInput\setInputType
setInputType($value)
Definition
HtmlInput.php:26
Ajax\common\html\html5\HtmlInput\forceValue
forceValue($value='true')
Definition
HtmlInput.php:30
Ajax\common\html\html5\HtmlInput\setPlaceholder
setPlaceholder($value)
Definition
HtmlInput.php:36
Ajax\common\html\traits\BaseHtmlPropertiesTrait\getProperty
getProperty($name)
Definition
BaseHtmlPropertiesTrait.php:35
Ajax\common\html\traits\BaseHtmlPropertiesTrait\setProperty
setProperty($name, $value)
Definition
BaseHtmlPropertiesTrait.php:30
Ajax\service\JString
Definition
JString.php:4
Ajax\common\html\html5
Definition
HtmlImg.php:3
Ajax
common
html
html5
HtmlInput.php
Generated on Sun Dec 10 2023 16:15:54 for
phpMv-UI
by
doxygen
1.9.8