00001 <?php
00024 require_once 'Zend/View/Helper/FormElement.php';
00025
00035 class Zend_View_Helper_FormLabel extends Zend_View_Helper_FormElement
00036 {
00045 public function formLabel($name, $value = null, array $attribs = array())
00046 {
00047 $info = $this->_getInfo($name, $value, $attribs);
00048 extract($info);
00049
00050
00051 if ($disable) {
00052
00053 return '';
00054 }
00055
00056 $value = ($escape) ? $this->view->escape($value) : $value;
00057 $for = (empty($attribs['disableFor']) || !$attribs['disableFor'])
00058 ? ' for="' . $this->view->escape($id) . '"'
00059 : '';
00060 if (array_key_exists('disableFor', $attribs)) {
00061 unset($attribs['disableFor']);
00062 }
00063
00064
00065 $xhtml = '<label'
00066 . $for
00067 . $this->_htmlAttribs($attribs)
00068 . '>' . $value . '</label>';
00069
00070 return $xhtml;
00071 }
00072 }