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


PHP PhpRenderer::formSubmit方法代码示例

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


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

示例1: renderFieldset

 /** {@inheritdoc} */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
 {
     $output = '';
     if ($fieldset->has('Packages')) {
         $packages = $fieldset->get('Packages');
         if ($packages->count()) {
             $formRow = $view->plugin('FormRow');
             $translatorEnabled = $formRow->isTranslatorEnabled();
             $formRow->setTranslatorEnabled(false);
             $output = "<div class='table'>\n";
             foreach ($packages as $package) {
                 $output .= $view->formRow($package, 'append') . "\n\n";
             }
             $output .= "<span class='cell'></span>\n";
             $output .= $view->formSubmit($fieldset->get('Submit')) . "\n";
             $output .= "</div>\n";
             $formRow->setTranslatorEnabled($translatorEnabled);
         }
     }
     return $output;
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:22,代码来源:Assign.php

示例2: renderFieldset

 /**
  * Render all elements from a fieldset
  *
  * This method iterates over all elements from the given fieldset and
  * renders them in a way appropriate for each element type. Subclasses with
  * more specialized rendering may extend or replace this method.
  *
  * @param \Zend\View\Renderer\PhpRenderer $view
  * @param \Zend\Form\Fieldset $fieldset
  * @return string HTML code
  */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
 {
     $output = '<div class="table">';
     foreach ($fieldset as $element) {
         $row = '';
         if ($element instanceof \Zend\Form\Element\Submit) {
             $row .= "<span class='cell'></span>\n";
             $row .= $view->formSubmit($element);
         } elseif ($element instanceof \Zend\Form\Fieldset) {
             $row .= $view->htmlTag('span', $view->translate($element->getLabel()), array('class' => 'label'), true) . "\n";
             $row .= $view->htmlTag('fieldset', "<legend></legend>\n" . $this->renderFieldset($view, $element));
         } elseif (!$element instanceof \Zend\Form\Element\Csrf) {
             $row .= $view->formRow($element, 'prepend', false);
             if ((string) $element->getLabel() == '') {
                 $row = "<div class='row'>\n<span class='label'></span>\n{$row}\n</div>";
             }
             if ($element->getMessages()) {
                 $row .= "\n<span class='cell'></span>\n";
                 $row .= $view->formElementErrors($element, array('class' => 'errors'));
             }
             if ($element->hasAttribute('id')) {
                 // The FormRow helper renders the label differently: It
                 // precedes the element instead of encapsulating it.
                 // Add a div wrapper to achieve the same appearance.
                 $row = "<div class='row'>\n{$row}\n</div>";
             }
         }
         $output .= $row . "\n";
     }
     $output .= "</div>\n";
     return $output;
 }
开发者ID:patrickpreuss,项目名称:Braintacle,代码行数:43,代码来源:Form.php


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