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


PHP MUtil_Html::createArray方法代码示例

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


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

示例1: __call

 /**
  * Overloading: allow rendering specific decorators
  *
  * Call renderDecoratorName() to render a specific decorator.
  *
  * @param  string $method
  * @param  array $args
  * @return \MUtil_Html_HtmlElement or at least something that implements the \MUtil_Html_HtmlInterface interface
  * @throws \Zend_Form_Exception for invalid decorator or invalid method call
  */
 public function __call($method, $args)
 {
     if ('render' == substr($method, 0, 6)) {
         return parent::__call($method, $args);
     }
     $elem = \MUtil_Html::createArray($method, $args);
     $value = $this->getValue();
     if (!$value instanceof \MUtil_Html_ElementInterface) {
         $value = new \MUtil_Html_Sequence();
     }
     $value->append($elem);
     $this->setValue($value);
     return $elem;
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:24,代码来源:Html.php

示例2: __call

 /**
  * For backward compatibility, allow \MUtil_Html calls to set or append to the title
  *
  * @param type $method
  * @param type $args
  * @return \Gems_Form_TabSubForm
  */
 public function __call($method, $args)
 {
     if ('render' == substr($method, 0, 6)) {
         return parent::__call($method, $args);
     }
     $elem = \MUtil_Html::createArray($method, $args);
     $value = $this->getAttrib('title');
     $value .= $elem->render($this->getView());
     $this->setAttrib('title', $value);
     //As the decorator might have been added already, update it also
     $decorator = $this->getDecorator('TabPane');
     $options = $decorator->getOption('jQueryParams');
     $options['title'] = strip_tags($value);
     $decorator->setOption('jQueryParams', $options);
     return $this;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:23,代码来源:TabSubForm.php

示例3: __call

 /**
  * Adds an HtmlElement to this element
  *
  * @see \MUtil_Html_Creator
  *
  * @param string $name Function name becomes tagname (unless specified otherwise in \MUtil_Html_Creator)
  * @param array $arguments The content and attributes values
  * @return \MUtil_Html_HtmlElement With '$name' tagName
  */
 public function __call($name, array $arguments)
 {
     $elem = \MUtil_Html::createArray($name, $arguments);
     $this[] = $elem;
     return $elem;
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:15,代码来源:Sprintf.php

示例4: smallData

 public static function smallData($value, $args_array = null)
 {
     $args = func_get_args();
     $element = \MUtil_Lazy::iff($value, \MUtil_Html::createArray('small', array(' [', $args, ']')));
     return $element;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:6,代码来源:Html.php

示例5: setHtml

 /**
  * Sets the layout to the use of html elements
  *
  * @see \MUtil_Html
  *
  * @param string $html HtmlTag for element or empty sequence when empty
  * @param string $args \MUtil_Ra::args additional arguments for element
  * @return \MUtil_Form (continuation pattern)
  */
 public function setHtml($html = null, $args = null)
 {
     $options = \MUtil_Ra::args(func_get_args(), 1);
     if ($html instanceof \MUtil_Html_ElementInterface) {
         if ($options) {
             foreach ($options as $name => $option) {
                 if (is_int($name)) {
                     $html[] = $option;
                 } else {
                     $html->{$name} = $option;
                 }
             }
         }
     } elseif (null == $html) {
         $html = new \MUtil_Html_Sequence($options);
     } else {
         $html = \MUtil_Html::createArray($html, $options);
     }
     if ($html instanceof \MUtil_Html_FormLayout) {
         $html->setAsFormLayout($this);
     } else {
         // Set this element as the form decorator
         $decorator = new \MUtil_Html_ElementDecorator();
         $decorator->setHtmlElement($html);
         // $decorator->setPrologue($formrep); // Renders hidden elements before this element
         $this->setDecorators(array($decorator, 'AutoFocus', 'Form'));
     }
     $this->_html_element = $html;
     return $this;
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:39,代码来源:Form.php

示例6: tr

 /**
  * Add a row with a class and the correct type of default child tag to this element
  *
  * @param mixed $arg_array MUtil::args() values
  * @return \MUtil_Html_TrElement
  */
 public function tr($arg_array = null)
 {
     $args = func_get_args();
     // Set default child tag first and het because otherwise
     // the children are created first and the default child tag
     // is set afterwards.
     if (!array_key_exists('DefaultChildTag', $args)) {
         array_unshift($args, array('DefaultChildTag' => $this->getDefaultRowChildTag()));
     }
     $tr = \MUtil_Html::createArray('tr', $args);
     $this[] = $tr;
     if (!isset($tr->class) && ($class = $this->getDefaultRowClass())) {
         $tr->class = $class;
     }
     return $tr;
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:22,代码来源:TBodyElement.php


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