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


PHP HTML_QuickForm2_Renderer::getOption方法代码示例

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


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

示例1: _renderRequiredNote

 public static function _renderRequiredNote(HTML_QuickForm2_Renderer $renderer, HTML_QuickForm2 $form)
 {
     if ($renderer->hasRequired && !$form->toggleFrozen(null)) {
         if (($note = $renderer->getOption('required_note')) && !empty($note)) {
             return '<div class="alert alert-info">' . $note . '</div>';
         }
     }
 }
开发者ID:sergiokessler,项目名称:perio,代码行数:8,代码来源:Callback.php

示例2: getOption

 public function getOption($name = null)
 {
     return $this->_renderer->getOption($name);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:4,代码来源:Proxy.php

示例3: _renderGroup

 public static function _renderGroup(HTML_QuickForm2_Renderer $renderer, HTML_QuickForm2_Container_Group $group)
 {
     $break = HTML_Common2::getOption('linebreak');
     $html[] = '<div class="row">';
     $html[] = $renderer->renderLabel($group);
     $error = $group->getError();
     if ($error) {
         $html[] = '<div class="element group error">';
         if ($renderer->getOption('group_errors')) {
             $renderer->errors[] = $error;
         } else {
             $html[] = '<span class="error">' . $error . '</span><br />';
         }
     } else {
         $html[] = '<div class="element group">';
     }
     $separator = $group->getSeparator();
     $elements = array_pop($renderer->html);
     if (!is_array($separator)) {
         $content = implode((string) $separator, $elements);
     } else {
         $content = '';
         $cSeparator = count($separator);
         for ($i = 0, $count = count($elements); $i < $count; $i++) {
             $content .= (0 == $i ? '' : $separator[($i - 1) % $cSeparator]) . $elements[$i];
         }
     }
     $html[] = $content;
     $html[] = '</div>';
     $html[] = '</div>';
     return implode($break, $html) . $break;
 }
开发者ID:grlf,项目名称:eyedock,代码行数:32,代码来源:Callback.php

示例4: render

 /**
  * Renders the container using the given renderer
  *
  * Container will be output N + 1 times, where N are visible items and 1 is
  * the hidden prototype used by Javascript code to create new items.
  *
  * @param HTML_QuickForm2_Renderer $renderer renderer to use
  *
  * @return   HTML_QuickForm2_Renderer
  */
 public function render(HTML_QuickForm2_Renderer $renderer)
 {
     $backup = $this->backupChildAttributes(true, true);
     $hiddens = $renderer->getOption('group_hiddens');
     $jsBuilder = $renderer->getJavascriptBuilder();
     $evalBuilder = new HTML_QuickForm2_Container_Repeat_JavascriptBuilder();
     $renderer->setJavascriptBuilder($evalBuilder)->setOption('group_hiddens', false)->startContainer($this);
     // first, render a (hidden) prototype
     $this->getPrototype()->addClass('repeatItem repeatPrototype');
     $this->getPrototype()->render($renderer);
     $this->getPrototype()->removeClass('repeatPrototype');
     // restore original JS builder
     $evalBuilder->passLibraries($jsBuilder);
     $renderer->setJavascriptBuilder($jsBuilder);
     // next, render all available rows
     foreach ($this->getIndexes() as $index) {
         $this->replaceIndexTemplates($index, $backup);
         /* @var HTML_QuickForm2_Node $child */
         foreach ($this->getRecursiveIterator() as $child) {
             if (isset($this->childErrors[$hash = spl_object_hash($child)]) && isset($this->childErrors[$hash][$index])) {
                 $child->setError($this->childErrors[$hash][$index]);
             }
         }
         $this->getPrototype()->render($renderer);
     }
     $this->restoreChildAttributes($backup);
     // only add javascript if not frozen
     if (!$this->toggleFrozen()) {
         $jsBuilder->addLibrary('repeat', 'quickform-repeat.js');
         $jsBuilder->addElementJavascript($this->_generateInitScript($evalBuilder));
         $this->renderClientRules($jsBuilder);
     }
     $renderer->finishContainer($this);
     $renderer->setOption('group_hiddens', $hiddens);
     return $renderer;
 }
开发者ID:andreaswarnaar,项目名称:HTML_QuickForm2.1,代码行数:46,代码来源:Repeat.php


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