本文整理汇总了PHP中Zend_Form_Decorator_HtmlTag类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Decorator_HtmlTag类的具体用法?PHP Zend_Form_Decorator_HtmlTag怎么用?PHP Zend_Form_Decorator_HtmlTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Form_Decorator_HtmlTag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: render
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$separator = ' ';
$placement = $this->getPlacement();
$tag = $this->getTag();
$tagClass = $this->getClass();
$id = $element->getId();
$errors = $element->getMessages();
if (!empty($errors)) {
$errors = implode('. ', $errors) . '.';
} else {
$errors = '';
}
if (null !== $tag) {
$decorator = new Zend_Form_Decorator_HtmlTag();
if (null !== $tagClass) {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-errors', 'class' => $tagClass));
} else {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-errors'));
}
$errors = $decorator->render($errors);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $errors;
case self::PREPEND:
return $errors . $separator . $content;
}
}
开发者ID:Webowiec,项目名称:zendnote,代码行数:34,代码来源:ErrorsHtmlTag.php
示例2: render
/**
* Render a label
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$label = $this->getLabel();
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$id = $this->getId();
$class = $this->getClass();
$options = $this->getOptions();
unset($options['tagOptions']);
$tagOptions = $this->getOption('tagOptions', array());
if (empty($label) && empty($tag)) {
return $content;
}
if (!empty($label)) {
$options['class'] = $class;
$label = $view->formLabel($element->getFullyQualifiedName(), trim($label), $options);
} else {
$label = ' ';
}
if (null !== $tag) {
$tagOptions['tag'] = $tag;
if (!isset($tagOptions['id'])) {
$tagOptions['id'] = $this->getElement()->getName() . '-label';
if (null !== ($belongsTo = $this->getElement()->getBelongsTo())) {
$tagOptions['id'] = $belongsTo . '-' . $tagOptions['id'];
}
}
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions($tagOptions);
$label = $decorator->render($label);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $label;
case self::PREPEND:
return $label . $separator . $content;
}
}
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:51,代码来源:Label.php
示例3: render
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$label = $this->getLabel();
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$tagClass = $this->getTagClass();
$id = $this->getId();
$class = $this->getClass();
$options = $this->getOptions();
if (empty($label) && empty($tag)) {
return $content;
}
if (!empty($label)) {
$options['class'] = $class;
$label = $view->formLabel($element->getFullyQualifiedName(), trim($label), $options);
} else {
$label = ' ';
}
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
if (null !== $this->_tagClass) {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-label', 'class' => $tagClass));
} else {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-label'));
}
$label = $decorator->render($label);
}
$buttons = '
<a id="video" href="#" class="btn btn-mini"><i class="icon-facetime-video"></i> Видео</a>
<a id="img" href="#" class="btn btn-mini"><i class="icon-picture"></i> Картинка</a>
';
switch ($placement) {
case self::APPEND:
return $content . $separator . $label . $buttons;
case self::PREPEND:
return $label . $buttons . $separator . $content;
}
}
开发者ID:romikring,项目名称:rcalex,代码行数:45,代码来源:BbButtons.php
示例4: render
public function render($content)
{
$form = $this->getElement();
$translator = $form->getTranslator();
$view = $form->getView();
if (null === $form->getActionBar()) {
return $content;
}
$items = array();
foreach ($form->getActionBar()->getElements() as $item) {
$item->setView($view)->setTranslator($translator);
$items[] = $item->render();
}
$elementContent = implode('', $items);
$decorator = new Zend_Form_Decorator_HtmlTag(array('tag' => 'li', 'class' => 'actions'));
$elementContent = $decorator->render($elementContent);
return $content . $elementContent;
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:18,代码来源:ActionBar.php
示例5: render
/**
* Render a label
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
if ($this->getOption('tagClass')) {
$tagClass = $this->getOption('tagClass');
$this->removeOption('tagClass');
}
$label = $this->getLabel();
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$id = $this->getId();
$class = $this->getClass();
$options = $this->getOptions();
if (empty($label) && empty($tag)) {
return $content;
}
if (!empty($label)) {
$options['class'] = $class;
$label = $view->formLabel($element->getFullyQualifiedName(), trim($label), $options);
} else {
$label = ' ';
}
if (null !== $tag) {
$decorator = new Zend_Form_Decorator_HtmlTag();
$options = array('tag' => $tag, 'id' => $this->getElement()->getName() . '-label');
if (isset($tagClass)) {
$options['class'] = $tagClass;
}
$decorator->setOptions($options);
$label = $decorator->render($label);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $label;
case self::PREPEND:
return $label . $separator . $content;
}
}
开发者ID:rom1git,项目名称:Centurion,代码行数:49,代码来源:Label.php
示例6: render
/**
* Render a label
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$label = $this->getLabel();
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$tagClass = method_exists($this, 'getTagClass') ? $this->getTagClass() : false;
$id = $this->getId();
$class = $this->getClass();
$options = $this->getOptions();
if (empty($label) && empty($tag)) {
return $content;
}
if (in_array(get_class($element), $this->_hiddenLabels)) {
$label = '';
} elseif (!empty($label)) {
$options['class'] = $class;
$label = $view->formLabel($element->getFullyQualifiedName(), trim($label), $options);
} else {
$label = ' ';
}
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
if ($tagClass && null !== $this->_tagClass) {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-label', 'class' => $tagClass));
} else {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-label'));
}
$label = $decorator->render($label);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $label;
case self::PREPEND:
return $label . $separator . $content;
}
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:49,代码来源:Label.php
示例7: render
/**
* Render a description
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
// Jdebug($element,'c');
$description = $element->getHelperBlock();
$description = trim($description);
if (!empty($description) && null !== ($translator = $element->getTranslator())) {
$description = $translator->translate($description);
}
if (empty($description)) {
return $content;
}
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$class = $this->getClass();
$escape = $this->getEscape();
$options = $this->getOptions();
if ($escape) {
$description = $view->escape($description);
}
if (!empty($tag)) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$options['tag'] = $tag;
$decorator = new Zend_Form_Decorator_HtmlTag($options);
$description = $decorator->render($description);
}
switch ($placement) {
case self::PREPEND:
return $description . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $description;
}
}
开发者ID:getJv,项目名称:ModuleTeste,代码行数:45,代码来源:HelperBlock.php
示例8: render
/**
* Render a label
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$label = $element->getLabel();
$label = trim($label);
if (!empty($label) && null !== ($translator = $element->getTranslator())) {
$label = $translator->translate($label);
}
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$options = $this->getOptions();
$tag = null;
if (isset($options['tag'])) {
$tag = $options['tag'];
unset($options['tag']);
}
if (empty($label) && empty($tag)) {
return $content;
}
if (!empty($label)) {
$label = $view->formLabel($element->getName(), $label, $options);
}
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions(array('tag' => $tag));
$label = $decorator->render($label);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $label;
case self::PREPEND:
return $label . $separator . $content;
}
}
开发者ID:dalinhuang,项目名称:popo,代码行数:45,代码来源:Label.php
示例9: render
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$description = $element->getDescription();
$description = trim($description);
if (!empty($description) && null !== ($translator = $element->getTranslator())) {
$description = $translator->translate($description);
}
if (empty($description)) {
return $content;
}
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$class = $this->getClass();
$escape = $this->getEscape();
$options = $this->getOptions();
if ($escape) {
$description = $view->escape($description);
}
$decorator = new Zend_Form_Decorator_HtmlTag(array('tag' => 'div', 'id' => $this->getElement()->getName() . '-desc', 'class' => $class));
$description = $decorator->render($description);
$decorator = new Zend_Form_Decorator_HtmlTag(array('tag' => 'td'));
$description = $decorator->render($description);
$description = '<td> </td>' . $description;
$decorator = new Zend_Form_Decorator_HtmlTag(array('tag' => 'tr'));
$description = $decorator->render($description);
switch ($placement) {
case self::PREPEND:
return $description . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $description;
}
}
开发者ID:niavok,项目名称:syj,代码行数:38,代码来源:TableDescription.php
示例10: render
/**
* Render a label
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$label = $this->getLabel();
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$tagClass = $this->getTagClass();
$id = $this->getId();
$class = $this->getClass();
$options = $this->getOptions();
if (empty($label) && empty($tag)) {
return $content;
}
if (!empty($label)) {
$options['class'] = $class;
$label = trim($label);
switch ($placement) {
case self::IMPLICIT:
// Break was intentionally omitted
// Break was intentionally omitted
case self::IMPLICIT_PREPEND:
$options['escape'] = false;
$options['disableFor'] = true;
$label = $view->formLabel($element->getFullyQualifiedName(), $label . $separator . $content, $options);
break;
case self::IMPLICIT_APPEND:
$options['escape'] = false;
$options['disableFor'] = true;
$label = $view->formLabel($element->getFullyQualifiedName(), $content . $separator . $label, $options);
break;
case self::APPEND:
// Break was intentionally omitted
// Break was intentionally omitted
case self::PREPEND:
// Break was intentionally omitted
// Break was intentionally omitted
default:
$label = $view->formLabel($element->getFullyQualifiedName(), $label, $options);
break;
}
} else {
$label = ' ';
}
if (null !== $tag) {
//require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
if (null !== $this->_tagClass) {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-label', 'class' => $tagClass));
} else {
$decorator->setOptions(array('tag' => $tag, 'id' => $id . '-label'));
}
$label = $decorator->render($label);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $label;
case self::PREPEND:
return $label . $separator . $content;
case self::IMPLICIT:
// Break was intentionally omitted
// Break was intentionally omitted
case self::IMPLICIT_PREPEND:
// Break was intentionally omitted
// Break was intentionally omitted
case self::IMPLICIT_APPEND:
return $label;
}
}
开发者ID:webino,项目名称:zf1,代码行数:79,代码来源:Label.php
示例11: render
/**
* Render a captcha image
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$tag = $this->getTag();
$placement = $this->getPlacement();
$separator = $this->getSeparator();
$namespace = $this->getOption('namespace');
$captchaId = $this->getOption('captchaId');
if (!$namespace || !$captchaId) {
require_once 'Zend/Form/Decorator/Exception.php';
$exception = new Zend_Form_Decorator_Exception('namespace or captchaId not set');
throw $exception;
}
$image = '<img src="/app/user/captcha/' . $namespace . '/' . $captchaId . '" alt="CAPTCHA challange" />';
//$red = imagecolorallocate($image, 255, 0,0);
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions(array('tag' => $tag));
$image = $decorator->render($image);
} else {
$image = '<tr><td> </td><td class=forminput valign="middle" align="left" width="65%">' . $image . '</td></tr>' . "\n";
$image = '<tr><td> </td><td></td></tr><tr><td> </td><td class=forminput valign="middle" align="left" width="65%">Type the characters you see in the picture below.</td></tr>' . "\n" . $image;
}
logfire('captcha', $image);
switch ($placement) {
case self::PREPEND:
return $image . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $image;
}
}
开发者ID:xinghao,项目名称:shs,代码行数:43,代码来源:Captcha.php
示例12: render
/**
* Render a form image
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$image = $this->getImage();
$tag = $this->getTag();
$placement = $this->getPlacement();
$separator = $this->getSeparator();
$options = $this->getOptions();
$image = $view->formImage($element->getName(), $image, $options);
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions(array('tag' => $tag));
$image = $decorator->render($image);
}
switch ($placement) {
case self::PREPEND:
return $image . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $image;
}
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:37,代码来源:Image.php
示例13: render
/**
* Render a label
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$label = $this->getTitle();
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$tag = $this->getTag();
$options = $this->getOptions();
if (empty($label) || empty($tag)) {
return $content;
}
//if (!empty($label)) {
//$options['class'] = $class;
//$label = $view->formLabel($element->getFullyQualifiedName(), trim($label), $options);
//} else {
// $label = ' ';
//}
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions(array('tag' => $tag));
$label = $decorator->render($label);
}
switch ($placement) {
case self::APPEND:
return $content . $separator . $label;
case self::PREPEND:
return $label . $separator . $content;
}
}
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:40,代码来源:FormTitle.php
示例14: render
/**
* Render a form image
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$tag = $this->getTag();
$placement = $this->getPlacement();
$separator = $this->getSeparator();
$name = $element->getFullyQualifiedName();
$attribs = $this->getAttribs();
$attribs['id'] = $element->getId();
$image = $view->formImage($name, $element->getImageValue(), $attribs);
if (null !== $tag) {
require_once LIB_DIR . '/Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions(array('tag' => $tag));
$image = $decorator->render($image);
}
switch ($placement) {
case self::PREPEND:
return $image . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $image;
}
}
开发者ID:Kliwer,项目名称:lms,代码行数:34,代码来源:Image.php
示例15: render
/**
* Render a tooltip
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$tooltip = $element->getAttrib('tooltip');
$tooltip = trim($tooltip);
//$element->removeAttrib('tooltip');
if (empty($tooltip)) {
return $content;
}
$view->headScript()->appendFile(\Zend_Controller_Front::getInstance()->getBaseUrl() . '/gems/js/jquery.cluetip.js');
$view->headLink()->appendStylesheet(\Zend_Controller_Front::getInstance()->getBaseUrl() . '/gems/js/jquery.cluetip.css');
$script = "\$('" . $this->getTag() . ".tooltip').cluetip({\n activation: 'click',\n sticky: 'true',\n closeText: '[X]',\n closePosition: 'title',\n width: 450,\n titleAttribute: 'tip',\n splitTitle: '|'})\n \$('#tabContainer').bind( 'tabsselect', function(event, ui) {\n \$(document).trigger('hideCluetip');\n});";
$view->jQuery()->addOnLoad($script);
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$class = $this->getClass();
$tag = $this->getTag();
$escape = $this->getEscape();
$options = $this->getOptions();
if ($escape) {
$tooltip = $view->escape($tooltip);
}
$options['tag'] = $tag;
$options['tip'] = str_replace('"', '\\"', $tooltip);
$decorator = new \Zend_Form_Decorator_HtmlTag($options);
$tooltip = $decorator->render($this->getImg()) . $decorator->setOptions(array('class' => 'thetooltip', 'id' => 'tooltip-' . $this->getElement()->getAttrib('id')))->render($tooltip);
switch ($placement) {
case self::PREPEND:
return $tooltip . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $tooltip;
}
/* Misschien later toch toevoegen */
$helper = $this->getHelper();
return $view->{$helper}($id, $content, $attribs);
}
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:47,代码来源:Tooltip.php
示例16: render
/**
* Decorate content and/or element
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$warnings = $element->getAttrib('warning');
$dimension = $element->getAttrib('dimension');
$class = ' ' . $this->getOption('class');
$class .= ' form-group';
//Add possibility to add custom classes to the form-group class by attribute
if ($element->getAttrib('formgroupclass')) {
$class .= ' ' . $element->getAttrib('formgroupclass');
}
if ($element->hasErrors()) {
$class .= ' has-error';
} elseif (!empty($warnings)) {
$class .= ' has-warning';
} elseif (true === $element->getAttrib('success')) {
$class .= ' has-success';
}
$class = trim($class);
if (!empty($class)) {
$this->setOption('class', $class);
}
$before = implode('', $this->_beforeContent);
$after = implode('', $this->_afterContent);
return parent::render($before . $content . $after);
}
开发者ID:wendrowycz,项目名称:zend1-bootstrap3,代码行数:32,代码来源:Container.php
示例17: render
/**
* Обернуть элементы управления в контейнер
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$class = ' ' . $this->getOption('class');
$dimensionControls = $this->getDimension();
if (!empty($dimensionControls)) {
foreach (explode(',', $dimensionControls) as $size) {
$class .= ' col-' . trim($size);
}
}
if (true == $this->isNoLabel() || null == $element->getLabel()) {
$dimensionLabel = $this->getDimensionLabel();
if (!empty($dimensionLabel)) {
foreach (explode(',', $dimensionLabel) as $size) {
$class .= ' col-' . trim(str_replace('-', '-offset-', $size));
}
}
}
if ('_File' == substr($element->getType(), -5)) {
$class .= ' form-control-static';
}
$class = trim($class);
if (!empty($class)) {
$this->setOption('class', $class);
}
return parent::render($content);
}
开发者ID:cliftonscott,项目名称:zend1-bootstrap3,代码行数:33,代码来源:HorizontalControls.php
示例18: render
/**
* Render container to appropiate size
*
* @param type $content
* @return type
*/
public function render($content)
{
$element = $this->getElement();
$class = $this->getOption('class');
$dimension = $this->getDimension();
if (!empty($dimension)) {
if (is_string($dimension)) {
foreach (explode(',', $dimension) as $size) {
$class .= ' col-' . trim($size);
}
}
$element->setAttrib('dimension', null);
}
$class = trim($class);
if (!empty($class)) {
$this->setOption('class', $class);
} else {
$this->removeOption('class');
}
$noAttribs = $this->getOption('noAttribs');
if (!$noAttribs) {
$attribs = $this->getOptions();
if (count($attribs) > 0) {
return parent::render($content);
}
}
return $content;
}
开发者ID:cliftonscott,项目名称:zend1-bootstrap3,代码行数:34,代码来源:FieldSize.php
示例19: render
/**
* Render
*
* @param string $content
* @return string
*/
public function render($content)
{
$clear = $this->getOption('clear');
$clearTag = $this->getOption('clearTag');
$this->removeOption('clear');
$this->removeOption('clearTag');
$element = $this->getElement();
$tag = $this->_getCloseTag($this->getTag());
if (!$element instanceof Zend_Form_Element_Hidden && isset($element->helper) && 'formHidden' !== $element->helper) {
if (method_exists($element, 'hasErrors') && $element->hasErrors()) {
$this->setOption('class', 'errors ' . $this->getOption('class'));
} else {
if (method_exists($element, 'isErrors') && $element->isErrors()) {
$this->setOption('class', 'errors ' . $this->getOption('class'));
}
}
}
$rendered = parent::render($content);
if (true === $clear && !empty($clearTag)) {
if (false !== ($pos = strripos($rendered, $tag))) {
$start = substr($rendered, 0, $pos);
$rendered = $start . $this->getOption('clearTag') . $tag;
}
}
return $rendered;
}
开发者ID:nstapelbroek,项目名称:Glitch_Lib,代码行数:32,代码来源:Wrapper.php
示例20: render
/**
* Render feedback wrapped
*
* @param string $content
* @return string
*/
public function render($content)
{
$attribs = $this->getOptions();
if (array_key_exists('class', $attribs)) {
$classes = explode(' ', $attribs['class']);
if (!in_array('form-control-feedback', $classes)) {
array_push($classes, 'form-control-feedback');
}
$this->setOption('class', implode(' ', $classes));
} else {
$this->setOption('class', 'form-control-feedback');
}
if (!array_key_exists('aria-hidden', $attribs)) {
$this->setOption('aria-hidden', 'true');
}
$element = $this->getElement();
$container = $element->getDecorator('Container');
if (!empty($container)) {
$classes = explode(' ', $container->getOption('class'));
if (!in_array('has-feedback', $classes)) {
array_push($classes, 'has-feedback');
}
$container->setOption('class', implode(' ', $classes));
}
return parent::render($content);
}
开发者ID:cliftonscott,项目名称:zend1-bootstrap3,代码行数:32,代码来源:Feedback.php
注:本文中的Zend_Form_Decorator_HtmlTag类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论