本文整理汇总了PHP中MUtil_Html::renderAny方法的典型用法代码示例。如果您正苦于以下问题:PHP MUtil_Html::renderAny方法的具体用法?PHP MUtil_Html::renderAny怎么用?PHP MUtil_Html::renderAny使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUtil_Html
的用法示例。
在下文中一共展示了MUtil_Html::renderAny方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render(\Zend_View_Abstract $view)
{
// \MUtil_Echo::r(sprintf('Rendering snippet %s.', get_class($this)));
//
// TODO: Change snippet workings.
// All forms are processed twice if hasHtmlOutput() is called here. This is
// a problem when downloading files.
// However: not being able to call hasHtmlOutput() twice is not part of the original plan
// so I gotta rework the forms. :(
//
if (!$this->hasHtmlOutput() && $this->getRedirectRoute()) {
$this->redirectRoute();
} else {
$html = $this->getHtmlOutput($view);
if ($html) {
if ($html instanceof \MUtil_Html_HtmlInterface) {
if ($html instanceof \MUtil_Html_HtmlElement) {
$this->applyHtmlAttributes($html);
}
return $html->render($view);
} else {
return \MUtil_Html::renderAny($view, $html);
}
}
}
}
示例2: render
/**
* Renders the element into a html string
*
* The $view is used to correctly encode and escape the output
*
* @param \Zend_View_Abstract $view
* @return string Correctly encoded and escaped html output
*/
public function render(\Zend_View_Abstract $view)
{
$html = '';
$glue = $this->getGlue();
foreach ($this->getIterator() as $key => $item) {
$html .= $glue;
if ($item instanceof \Gems_Menu_SubMenuItem) {
$item = $this->toActionLink($key);
}
$html .= \MUtil_Html::renderAny($view, $item);
}
return substr($html, strlen($glue));
}
示例3: renderElement
/**
* Function to allow overloading of tag rendering only
*
* Renders the element tag with it's content into a html string
*
* The $view is used to correctly encode and escape the output
*
* @param \Zend_View_Abstract $view
* @return string Correctly encoded and escaped html output
*/
protected function renderElement(\Zend_View_Abstract $view)
{
$this->_currentContent = array();
// If the label was assigned an element lazy,
// now is the time to get it's value.
foreach ($this->_content as $key => $value) {
if ($value instanceof \MUtil_Lazy_LazyInterface) {
$value = \MUtil_Lazy::rise($value);
}
if ($value instanceof \Zend_Form_Element) {
if ($value instanceof \Zend_Form_Element_Hidden) {
return null;
}
// Only a label when a label decorator exists, but we do not use that decorator
$decorator = $value->getDecorator('Label');
if ($decorator) {
if (false === $decorator->getOption('escape')) {
$label = \MUtil_Html::raw($value->getLabel());
} else {
$label = $value->getLabel();
}
$class = $this->class ? \MUtil_Html::renderAny($view, $this->class) . ' ' : '';
if ($value->isRequired()) {
$class .= $this->getRequiredClass();
$this->_currentContent[$key] = array($this->getRequiredPrefix(), $label, $this->getRequiredPostfix());
} else {
$class .= $this->getOptionalClass();
$this->_currentContent[$key] = array($this->getOptionalPrefix(), $label, $this->getOptionalPostfix());
}
parent::__set('class', $class);
// Bypass existing property for drawing
if ($id = $value->getId()) {
parent::__set('for', $id);
// Always overrule
} else {
parent::__unset('for');
}
}
} elseif ($value instanceof \Zend_Form_DisplayGroup) {
return null;
} else {
$this->_currentContent[$key] = $value;
}
}
return parent::renderElement($view);
}
示例4: html
/**
* Generates a fake element that just displays the item with a hidden extra value field.
*
* @access public
*
* @param string|array $name If a string, the element name. If an
* array, all other parameters are ignored, and the array elements
* are extracted in place of added parameters.
*
* @param mixed $value The element value.
*
* @param array $attribs Attributes for the element tag.
*
* @return string The element XHTML.
*/
public function html($name, $value = null, $attribs = null)
{
return \MUtil_Html::renderAny($this->view, $value);
}