• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/Zend/View/Helper/FormLabel.php

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); // name, value, attribs, options, listsep, disable, escape
00049 
00050         // build the element
00051         if ($disable) {
00052             // disabled; display nothing
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         // enabled; display label
00065         $xhtml = '<label'
00066                 . $for
00067                 . $this->_htmlAttribs($attribs)
00068                 . '>' . $value . '</label>';
00069 
00070         return $xhtml;
00071     }
00072 }

Generated on Thu Apr 19 2012 17:01:18 for openbiz by  doxygen 1.7.2