当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element::getDecorator方法代码示例

本文整理汇总了PHP中Zend_Form_Element::getDecorator方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element::getDecorator方法的具体用法?PHP Zend_Form_Element::getDecorator怎么用?PHP Zend_Form_Element::getDecorator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element的用法示例。


在下文中一共展示了Zend_Form_Element::getDecorator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setElementDecorator

 /**
  * Static function that adds all the elements in 1 wrapping element instead of dt, dd structure
  *
  * @param $elm
  * @return void
  */
 public static function setElementDecorator(Zend_Form_Element $elm)
 {
     $elm->addPrefixPath('Glitch_Form_Decorator', 'Glitch/Form/Decorator/', 'decorator');
     $labelSettings = array();
     if ($elm->getDecorator('Label')) {
         $labelSettings = $elm->getDecorator('Label')->getOptions();
         unset($labelSettings['tag']);
         //Tag should never be needed when you call this method
     }
     $class = 'wrapper';
     if ($elm->getAttrib('wrapperClass')) {
         $class .= ' ' . $elm->getAttrib('wrapperClass');
         $elm->setAttrib('wrapperClass', null);
     }
     if ($elm instanceof Zend_Form_Element_Hidden) {
         $class .= ' hidden';
     }
     $elm->clearDecorators()->addDecorator('Label', $labelSettings)->addDecorator('ViewHelper')->addDecorator('Description', array('escape' => false))->addDecorator('Errors')->addDecorator('Wrapper', array('tag' => 'div', 'id' => $elm->getName() . '-wrapper', 'class' => $class));
     if ($elm instanceof Zend_Form_Element_Submit) {
         $elm->removeDecorator('Label');
     }
 }
开发者ID:nstapelbroek,项目名称:Glitch_Lib,代码行数:28,代码来源:Form.php

示例2: _getClassNamesFromDecorator

 /**
  * Retorna as classes CSS de Decorator de um Zend_Form_Element quando fornecido 
  * OU do proprio elemento por padrão
  *
  * @param Zend_Form_Element $element
  * @return array
  * @author Jhonatan Morais <jhonatanvinicius@gmail.com>
  */
 protected function _getClassNamesFromDecorator($decoratorName, Zend_Form_Element $element = null)
 {
     if (null !== $element) {
         return explode(' ', $element->getDecorator($decoratorName)->getOption('class'));
     }
     //Jdebug($decoratorName);
     return explode(' ', $this->getDecorator($decoratorName)->getOption('class'));
 }
开发者ID:getJv,项目名称:ModuleTeste,代码行数:16,代码来源:Element.php

示例3: getCssClass

 /**
  * Retorna um array com as classes CSS utilizadas em um Zend_Form_Element
  * @param Zend_Form_Element $element elemento a ser consultado
  * @return array Retorna um array com cada classe encontrada
  * @author Jhonatan Morais <jhonatanvinicius@gmail.com>
  */
 public function getCssClass(Zend_Form_Element $element, $fromDecorator = null)
 {
     if (is_null($fromDecorator)) {
         return explode(' ', $element->getAttrib('class'));
     }
     return explode(' ', $element->getDecorator($fromDecorator)->getOption('class'));
 }
开发者ID:getJv,项目名称:ModuleTeste,代码行数:13,代码来源:MyBootstrapUtils.php

示例4: setClassToAnElement

 /**
  * Set an error class into element HtmlTag decorator
  *
  * @param Zend_Form_Element $element    Element to 'decorate' for the error.
  * @param string            $styleClass CSS class name.
  *
  * @return void
  */
 protected function setClassToAnElement(Zend_Form_Element $element, $styleClass)
 {
     $htmlTagDecorator = $element->getDecorator('HtmlTag');
     if (!empty($htmlTagDecorator)) {
         $class = $htmlTagDecorator->getOption('class');
         $htmlTagDecorator->setOption('class', $class . ' ' . $styleClass);
     }
 }
开发者ID:cliftonscott,项目名称:EasyBib_Form_Decorator,代码行数:16,代码来源:Form.php


注:本文中的Zend_Form_Element::getDecorator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。