00001 <?php
00024 require_once 'Zend/View/Helper/FormElement.php';
00025
00034 class Zend_View_Helper_Fieldset extends Zend_View_Helper_FormElement
00035 {
00044 public function fieldset($name, $content, $attribs = null)
00045 {
00046 $info = $this->_getInfo($name, $content, $attribs);
00047 extract($info);
00048
00049
00050 $legend = '';
00051 if (isset($attribs['legend'])) {
00052 $legendString = trim($attribs['legend']);
00053 if (!empty($legendString)) {
00054 $legend = '<legend>'
00055 . (($escape) ? $this->view->escape($legendString) : $legendString)
00056 . '</legend>' . PHP_EOL;
00057 }
00058 unset($attribs['legend']);
00059 }
00060
00061
00062 if (!empty($id)) {
00063 $id = ' id="' . $this->view->escape($id) . '"';
00064 } else {
00065 $id = '';
00066 }
00067
00068
00069 $xhtml = '<fieldset'
00070 . $id
00071 . $this->_htmlAttribs($attribs)
00072 . '>'
00073 . $legend
00074 . $content
00075 . '</fieldset>';
00076
00077 return $xhtml;
00078 }
00079 }