XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
formtext.php
Go to the documentation of this file.
1 <?php
21 defined('XOOPS_ROOT_PATH') or die('Restricted access');
22 
27 {
34  var $_size;
35 
43 
50  var $_value;
51 
61  function XoopsFormText($caption, $name, $size, $maxlength, $value = '')
62  {
63  $this->setCaption($caption);
64  $this->setName($name);
65  $this->_size = intval($size);
66  $this->_maxlength = intval($maxlength);
67  $this->setValue($value);
68  }
69 
75  function getSize()
76  {
77  return $this->_size;
78  }
79 
85  function getMaxlength()
86  {
87  return $this->_maxlength;
88  }
89 
96  function getValue($encode = false)
97  {
98  return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
99  }
100 
106  function setValue($value)
107  {
108  $this->_value = $value;
109  }
110 
116  function render()
117  {
118  return "<input type='text' name='" . $this->getName() . "' title='" . $this->getTitle() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . " />";
119  }
120 }
121 
122 ?>