XOOPS  2.6.0
Label.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 Label extends Element
26 {
27 
35  public function __construct($caption = '', $value = '', $name = '')
36  {
37  $this->setCaption($caption);
38  $this->setName($name);
39  $this->setValue($value);
40  }
41 
47  public function render()
48  {
49  $idName = $this->getName();
50  $id = empty($idName) ? '' : ' id="' . $idName . '"';
51  $ret = '<span' . $id . '>' . $this->getValue() . '</span>';
52  return $ret;
53  }
54 }
__construct($caption= '', $value= '', $name= '')
Definition: Label.php:35
setValue($value)
Definition: Element.php:199
getValue($encode=false)
Definition: Element.php:180
setCaption($caption)
Definition: Element.php:396
$id
Definition: admin_menu.php:36