/** * Render HTML form * * @param string $name Form name * @param null|array $attribs HTML form attributes * @param false|string $content Form content * @return string */ public function form($name, $attribs = null, $content = false) { $info = $this->_getInfo($name, $content, $attribs); extract($info); if (!empty($name)) { $name = ' name="' . $this->view->escape($name) . '"'; } if (!empty($id)) { $id = ' id="' . $this->view->escape($id) . '"'; } $xhtml = '<form' . $name . $id . $this->_htmlAttribs($attribs) . '>'; if (false !== $content) { $xhtml .= $content . '</form>'; } return $xhtml; }
/** * Render HTML form * * @param string $name Form name * @param string $content Form content * @param array $attribs HTML form attributes * @return string */ public function fieldset($name, $content, $attribs = null) { $info = $this->_getInfo($name, $content, $attribs); extract($info); $legend = ''; if (isset($attribs['legend'])) { $legend = '<legend>' . $this->view->escape($attribs['legend']) . '</legend>' . PHP_EOL; unset($attribs['legend']); } $xhtml = '<fieldset' . ' id="' . $this->view->escape($id) . '"' . $this->_htmlAttribs($attribs) . '>' . $legend . $content . '</fieldset>'; return $xhtml; }
/** * Render HTML form * * @param string $name Form name * @param string $content Form content * @param array $attribs HTML form attributes * @return string */ public function fieldset($name, $content, $attribs = null) { $info = $this->_getInfo($name, $content, $attribs); extract($info); // get legend $legend = ''; if (isset($attribs['legend'])) { $legendString = trim($attribs['legend']); if (!empty($legendString)) { $legend = '<legend>' . $this->view->escape($legendString) . '</legend>' . PHP_EOL; } unset($attribs['legend']); } // render fieldset $xhtml = '<fieldset' . ' id="' . $this->view->escape($id) . '"' . $this->_htmlAttribs($attribs) . '>' . $legend . $content . '</fieldset>'; return $xhtml; }