XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
Button.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
namespace
Xoops\Form
;
13
25
class
Button
extends
Element
26
{
27
36
public
function
__construct
(
$caption
,
$name
,
$value
=
""
,
$type
=
"button"
)
37
{
38
$this->
setCaption
(
$caption
);
39
$this->
setAttribute
(
'type'
,
$type
);
40
$this->
setAttribute
(
'name'
,
$name
);
41
$this->
setValue
(
$value
);
42
}
43
49
public
function
getType
()
50
{
51
return
(
string
) $this->
getAttribute
(
'type'
);
52
//return in_array(strtolower($this->type), array("button", "submit", "reset")) ? $this->type : "button";
53
}
54
60
public
function
render
()
61
{
62
$this->
addAttribute
(
'class'
,
'btn'
);
63
64
$attributes
= $this->
renderAttributeString
();
65
return
'<input '
.
$attributes
.
'value="'
. $this->
getValue
()
66
.
'" '
. $this->
getExtra
() .
' >'
;
67
}
68
}
Xoops\Form\Element\setValue
setValue($value)
Definition:
Element.php:199
Xoops\Form\Element\getValue
getValue($encode=false)
Definition:
Element.php:180
Xoops\Form\Element\setCaption
setCaption($caption)
Definition:
Element.php:396
Xoops\Form
Definition:
BlockForm.php:12
Xoops\Form\Element\renderAttributeString
renderAttributeString()
Definition:
Element.php:156
Xoops\Html\Attributes\setAttribute
setAttribute($name, $value=null)
Definition:
Attributes.php:42
Xoops\Html\Attributes\getAttribute
getAttribute($name)
Definition:
Attributes.php:86
Xoops\Form\Button\getType
getType()
Definition:
Button.php:49
Xoops\Form\Element\getExtra
getExtra($encode=false)
Definition:
Element.php:539
Xoops\Form\Button\__construct
__construct($caption, $name, $value="", $type="button")
Definition:
Button.php:36
Xoops\Form\Button\render
render()
Definition:
Button.php:60
Xoops\Form\Element
Definition:
Element.php:28
Xoops\Form\Element\$caption
$caption
Definition:
Element.php:55
Xoops\Html\Attributes\addAttribute
addAttribute($name, $value)
Definition:
Attributes.php:117
Xoops\Form\Button
Definition:
Button.php:25
$type
$type
Definition:
misc.php:33
$name
$name
Definition:
force_download.php:15
Xoops\Form\Element\$value
$value
Definition:
Element.php:131
Xoops\Html\Attributes\$attributes
$attributes
Definition:
Attributes.php:32
usr64
htdocs
xoops_lib
Xoops
Form
Button.php
Generated on Fri May 22 2015 03:07:05 for XOOPS by
1.8.9.1