當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTML_QuickForm2_Renderer::renderLabel方法代碼示例

本文整理匯總了PHP中HTML_QuickForm2_Renderer::renderLabel方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTML_QuickForm2_Renderer::renderLabel方法的具體用法?PHP HTML_QuickForm2_Renderer::renderLabel怎麽用?PHP HTML_QuickForm2_Renderer::renderLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTML_QuickForm2_Renderer的用法示例。


在下文中一共展示了HTML_QuickForm2_Renderer::renderLabel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _renderGroup

 public static function _renderGroup(HTML_QuickForm2_Renderer $renderer, HTML_QuickForm2_Container_Group $group)
 {
     $error = $group->getError();
     if ($error) {
         $html[] = '<div class="form-group error">';
         $renderer->errors[] = $error;
     } else {
         $html[] = '<div class="form-group">';
     }
     $html[] = "\n";
     $html[] = $renderer->renderLabel($group);
     $html[] = '<div class="form-control">';
     //        $html[] = '<div class="input inline">';
     $html[] = "\n";
     $separator = $group->getSeparator();
     /*
             foreach ($group as $element) {
                 echo '<pre>';
                 var_dump($element);
                 echo '</pre>';
                 //$elements[] = (string)$element;
             }
     */
     /*
             $elements[]  = (string)array_pop($group->getElements());
             echo '<pre>';
             //var_dump($elements);
             echo '</pre>';
             /*
             foreach($elements as $k => $v)
             {
                 $elements[$k] = (string)$elements[$k];
             }*/
     /*
         echo '<pre>';
         //var_dump($elements);
         echo '</pre>';
     */
     $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;
     if ($error) {
         $html[] = '<span class="help-inline">' . $error . '</span>';
     } else {
         $label = $group->getLabel();
         if (is_array($label) && !empty($label[1])) {
             $html[] = '<span class="help-block">' . $label[1] . '</span>';
         }
     }
     $html[] = "\n";
     //        $html[] = '</div>';
     $html[] = '</div>';
     $html[] = '</div><!-- of group -->';
     return implode('', $html);
     /*
     $break = HTML_Common2::getOption('linebreak');
     //$html[] = '<div class="row">';
     $error = $group->getError();
     if ($error) {
         $html[] = '<div class="form-inline control-group error">';
         $html[] = $renderer->renderLabel($group);
     
         if ($renderer->getOption('group_errors')) {
             $renderer->errors[] = $error;
         } else {
             $html[] = '<span class="help-inline">'.$error.'</span><br />';
         }
     } else {
         $html[] = '<span class="form-inline">';
         $html[] = $renderer->renderLabel($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[] = '</span>';
     //$html[] = '</div>';
     return implode($break, $html) . $break;
     */
 }
開發者ID:sergiokessler,項目名稱:perio,代碼行數:98,代碼來源:Callback.php

示例2: _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


注:本文中的HTML_QuickForm2_Renderer::renderLabel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。