XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
TextArea.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
TextArea
extends
Element
26
{
32
//protected $cols;
33
39
//protected $rows;
40
46
//private $placeholder;
47
48
59
public
function
__construct
(
$caption
,
$name
,
$value
=
""
, $rows = 5, $cols = 5, $placeholder =
''
)
60
{
61
$this->
setCaption
(
$caption
);
62
$this->
setAttribute
(
'name'
,
$name
);
63
$this->
setAttribute
(
'rows'
, intval($rows));
64
$this->
setAttribute
(
'cols'
, intval($cols));
65
$this->
setValue
(
$value
);
66
$this->
setAttribute
(
'placeholder'
, $placeholder);
67
68
}
69
75
public
function
getRows
()
76
{
77
return
(
int
) $this->
getAttribute
(
'rows'
);
78
}
79
85
public
function
getCols
()
86
{
87
return
(
int
) $this->
getAttribute
(
'cols'
);
88
}
89
95
public
function
getPlaceholder
()
96
{
97
return
(
string
) $this->
getAttribute
(
'placeholder'
);
98
}
99
105
public
function
render
()
106
{
107
if
($this->
getCols
() > $this->
getMaxcols
()) {
108
$maxcols
= $this->
getMaxcols
();
109
}
else
{
110
$maxcols
= $this->
getCols
();
111
}
112
$this->
addAttribute
(
'class'
,
'span'
.
$maxcols
);
113
114
$attributes
= $this->
renderAttributeString
();
115
return
'<textarea '
.
$attributes
.
' '
. $this->
getExtra
() .
' >'
116
. $this->
getValue
() .
'</textarea>'
;
117
}
118
}
Xoops\Form\TextArea
Definition:
TextArea.php:25
Xoops\Form\TextArea\getRows
getRows()
Definition:
TextArea.php:75
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\Form\TextArea\__construct
__construct($caption, $name, $value="", $rows=5, $cols=5, $placeholder= '')
Definition:
TextArea.php:59
Xoops\Html\Attributes\setAttribute
setAttribute($name, $value=null)
Definition:
Attributes.php:42
Xoops\Html\Attributes\getAttribute
getAttribute($name)
Definition:
Attributes.php:86
Xoops\Form\Element\getMaxcols
getMaxcols()
Definition:
Element.php:585
Xoops\Form\TextArea\getPlaceholder
getPlaceholder()
Definition:
TextArea.php:95
Xoops\Form\Element\getExtra
getExtra($encode=false)
Definition:
Element.php:539
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\TextArea\getCols
getCols()
Definition:
TextArea.php:85
Xoops\Form\TextArea\render
render()
Definition:
TextArea.php:105
$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
Xoops\Form\Element\$maxcols
$maxcols
Definition:
Element.php:139
usr64
htdocs
xoops_lib
Xoops
Form
TextArea.php
Generated on Fri May 22 2015 03:07:00 for XOOPS by
1.8.9.1