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


PHP Fieldset::getName方法代码示例

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


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

示例1: renderFieldset

 /** {@inheritdoc} */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
 {
     if ($fieldset->getName()) {
         return parent::renderFieldset($view, $fieldset);
     }
     // Reimplement form renderer to align submit button with elements from Preferences fieldset.
     $output = "<div class='table'>\n";
     foreach ($this->get('Preferences') as $element) {
         if ($element instanceof \Zend\Form\Fieldset) {
             $output .= $view->htmlElement('span', $view->translate($element->getLabel()), array('class' => 'label'), true) . "\n";
             $output .= $view->htmlElement('fieldset', "<legend></legend>\n" . $this->renderFieldset($view, $element));
         } else {
             $output .= $view->formRow($element, 'prepend', false);
             if ($element->getMessages()) {
                 $output .= "\n<div class='row'>\n<span class='cell'></span>\n";
                 $output .= $view->formElementErrors($element, array('class' => 'errors'));
                 $output .= "\n</div>";
             }
         }
         $output .= "\n";
     }
     $output .= "<div class='row'>\n";
     $output .= "<span class='cell'></span>\n";
     $output .= $view->formRow($this->get('Submit'));
     $output .= "\n</div>\n</div>\n";
     return $output;
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:28,代码来源:AbstractForm.php

示例2: renderFieldset

 /** {@inheritdoc} */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
 {
     $output = '';
     if ($fieldset->getName() == 'Deploy') {
         foreach ($fieldset as $element) {
             // Default renderer would prepend
             $output .= $view->formRow($element, 'append') . "\n";
         }
     } else {
         $output .= parent::renderFieldset($view, $fieldset);
     }
     return $output;
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:14,代码来源:Update.php

示例3: renderFieldset

 /**
  * Render a Fieldset
  *
  * @param  \Zend\Form\Fieldset $fieldset
  * @return string
  */
 public function renderFieldset(Fieldset $fieldset)
 {
     $id = $fieldset->getAttribute('id') ?: $fieldset->getName();
     $class = $fieldset->getAttribute('class');
     $label = $fieldset->getLabel();
     if (!empty($label)) {
         $label = "<legend>{$label}</legend>";
     }
     return '<fieldset id="fieldset-' . $id . '" class="' . $class . '">' . $label . $this->render($fieldset) . '</fieldset>';
 }
开发者ID:suitedJK,项目名称:ZfcTwitterBootstrap,代码行数:16,代码来源:Form.php

示例4: renderFieldset

 /** {@inheritdoc} */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
 {
     $name = $fieldset->getName();
     if ($name) {
         $default = $view->translate('Default');
         $effective = $view->translate('Effective');
         $yes = $view->translate('Yes');
         $no = $view->translate('No');
         switch ($name) {
             case 'Agent':
                 $legend = $view->translate('Agent');
                 break;
             case 'Download':
                 $legend = $view->translate('Download');
                 break;
             case 'Scan':
                 $legend = $view->translate('Network scanning');
                 break;
         }
         $output = "<div class='table'>\n";
         foreach ($fieldset as $element) {
             if ($element->getAttribute('disabled')) {
                 continue;
             }
             preg_match('/.*\\[(.*)\\]$/', $element->getName(), $matches);
             $option = $matches[1];
             if ($option == 'scanThisNetwork') {
                 $row = '';
             } else {
                 $defaultValue = $this->_object->getDefaultConfig($option);
                 if ($element instanceof Element\Checkbox) {
                     $defaultValue = $defaultValue ? $yes : $no;
                 }
                 $row = sprintf('%s: %s', $default, $defaultValue);
                 if ($this->_object instanceof \Model\Client\Client) {
                     $effectiveValue = $this->_object->getEffectiveConfig($option);
                     if ($element instanceof Element\Checkbox) {
                         $effectiveValue = $effectiveValue ? $yes : $no;
                     }
                     $row .= sprintf(', %s: %s', $effective, $effectiveValue);
                 }
                 $row = $view->escapeHtml("({$row})");
             }
             if ($element->getMessages()) {
                 $element->setAttribute('class', 'input-error');
             }
             $row = $view->htmlElement('span', $view->formElement($element) . $row, array('class' => 'values'));
             $row = $view->htmlElement('span', $view->translate($element->getLabel()), array('class' => 'label')) . $row;
             $output .= $view->htmlElement('label', $row);
             if ($element->getMessages()) {
                 $output .= $view->htmlElement('span', null, array('class' => 'cell'));
                 $output .= $view->formElementErrors($element, array('class' => 'error'));
             }
         }
         $output .= "</div>\n";
         $output = $view->htmlElement('fieldset', $view->htmlElement('legend', $legend) . $output);
     } else {
         $output = "<div class='table'>\n";
         foreach ($fieldset as $element) {
             if ($element instanceof \Zend\Form\Fieldset) {
                 $output .= $this->renderFieldset($view, $element);
             }
         }
         $output .= $view->formRow($fieldset->get('Submit'));
         $output .= "</div>\n";
     }
     return $output;
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:69,代码来源:ClientConfig.php

示例5: renderFieldset

 /** {@inheritdoc} */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset = null)
 {
     $output = '';
     $name = $fieldset->getName();
     switch ($name) {
         case 'inspect':
             $output .= "<div class='textcenter'>\n";
             $output .= $view->formRow($fieldset->get('inspect'), 'append') . "\n";
             $output .= "</div>\n";
             break;
         case 'existing':
             $table = '';
             foreach ($this->_definedValues as $value) {
                 $id = $value['Id'];
                 $element = $fieldset->get("value_{$id}_name");
                 $row = $view->htmlElement('td', $view->formElement($element) . $view->formElementErrors($element, array('class' => 'errors')));
                 $row .= $view->htmlElement('td', $view->escapeHtml($element->getLabel()));
                 $row .= $view->htmlElement('td', $view->htmlElement('a', $view->translate('Delete'), array('href' => $view->consoleUrl('preferences', 'deleteregistryvalue', array('name' => $value['Name'])))));
                 $table .= $view->htmlElement('tr', $row);
             }
             $output .= $view->htmlElement('table', $table);
             break;
         case 'new_value':
             $output .= parent::renderFieldset($view, $fieldset);
             break;
         default:
             if ($fieldset == $this) {
                 $output .= $this->renderFieldset($view, $fieldset->get('inspect'));
                 if (count($this->_definedValues)) {
                     $output .= $view->htmlElement('h2', $view->translate('Values'));
                     $output .= $this->renderFieldset($view, $fieldset->get('existing'));
                 }
                 $output .= $view->htmlElement('h2', $view->translate('Add'));
                 $output .= $this->renderFieldset($view, $fieldset->get('new_value'));
             }
             break;
     }
     return $output;
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:40,代码来源:ManageRegistryValues.php

示例6: renderFieldset

 /** {@inheritdoc} */
 public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
 {
     if ($fieldset->getName() == 'Fields') {
         // Labels (except "Category") are user defined and must not be translated.
         $fieldset->get('TAG')->setLabel($view->translate('Category'));
         $formRow = $view->plugin('FormRow');
         $translatorEnabled = $formRow->isTranslatorEnabled();
         $formRow->setTranslatorEnabled(false);
         $output = parent::renderFieldset($view, $fieldset);
         $formRow->setTranslatorEnabled($translatorEnabled);
     } else {
         $output = $this->renderFieldset($view, $this->get('Fields'));
         $output .= "<div class='table'>\n";
         $output .= "<span class='cell'></span>\n";
         $output .= $view->formSubmit($fieldset->get('Submit')) . "\n";
         $output .= "</div>\n";
     }
     return $output;
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:20,代码来源:CustomFields.php

示例7: renderFieldset

 /**
  * Render a Fieldset
  *
  * @param Zend\Form\Fieldset $fieldset
  * @return void
  */
 public function renderFieldset(Fieldset $fieldset)
 {
     $id = $fieldset->getAttribute('id') ?: $fieldset->getName();
     return '<fieldset id="fieldset-' . $id . '">' . $this->render($fieldset) . '</fieldset>';
 }
开发者ID:rwoverdijk,项目名称:sxbootstrap,代码行数:11,代码来源:Form.php

示例8: renderFieldset

 /**
  * @param Fieldset $fieldset
  * @param boolean  $groupActions
  *
  * @return HtmlElement
  */
 protected function renderFieldset(Fieldset $fieldset, $groupActions = false)
 {
     $fieldsetElement = new HtmlElement('fieldset');
     $id = $fieldset->getAttribute('id') ?: $fieldset->getName();
     $parent = $this->getElement();
     $fieldsetElement->addAttribute('id', $id);
     /**
      * This changes the scope of the current element,
      * so that the child elements (the ones that are about to be rendered),
      * will be set on the fieldset.
      * Then change it back again so that the fieldset will be added to the form.
      */
     $this->setElement($fieldsetElement)->renderElements($fieldset, $groupActions)->setElement($parent);
     return $fieldsetElement;
 }
开发者ID:spoonx,项目名称:sxbootstrap,代码行数:21,代码来源:Form.php


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