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


PHP Fieldset::setAttribute方法代码示例

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


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

示例1: renderWidgetList

 private function renderWidgetList($value, $choices, $attributes)
 {
     $name = $this->getAttribute('name');
     $flags = $this->getAttribute('flags');
     $hiddenWidget = new Hidden($this->view);
     $hiddenWidget->setAttribute('flags', $flags)->setAttribute('value', '')->setAttribute('class', 'Hidden')->setAttribute('name', $name);
     $contentWidget = new Literal($this->view);
     $contentWidget->setAttribute('data', $this->generateSelectorContentWidgetList($name, $value, $choices, $flags));
     $panelWidget = new Panel($this->view);
     $panelWidget->setAttribute('class', $attributes['class'])->setAttribute('name', $name)->insert($hiddenWidget)->insert($contentWidget);
     if ($this->getAttribute('flags') & \Nethgui\Renderer\WidgetFactoryInterface::LABEL_NONE) {
         return $panelWidget->renderContent();
     }
     $fieldsetWidget = new Fieldset($this->view);
     $fieldsetWidget->setAttribute('template', $this->getAttribute('label', $this->getTranslateClosure($name . '_label')))->setAttribute('flags', $this->getAttribute('flags'));
     if ($this->hasAttribute('icon-before')) {
         $fieldsetWidget->setAttribute('icon-before', $this->getAttribute('icon-before'));
     }
     $fieldsetWidget->insert($panelWidget);
     return $fieldsetWidget->renderContent();
 }
开发者ID:SystemEd-Jacob,项目名称:nethgui,代码行数:21,代码来源:Selector.php

示例2: renderContent

 protected function renderContent()
 {
     $this->initializeRendering();
     $content = '';
     $content .= $this->openTag('div', array('class' => 'ObjectPicker ' . implode(' ', $this->metadata['listenToEvents'])));
     // render the an hidden input, as fallback empty post value:
     foreach ($this->getChildren() as $child) {
         $content .= $this->selfClosingTag('input', array('type' => 'hidden', 'value' => '', 'name' => $this->getControlName($child->getAttribute('name'))));
     }
     $content .= $this->renderMeta();
     $content .= $this->renderObjects();
     $content .= $this->closeTag('div');
     if ($this->hasAttribute('template')) {
         $fieldsetWidget = new Fieldset($this->view);
         $fieldsetWidget->setAttribute('template', $this->getAttribute('template'))->setAttribute('icon-before', $this->getAttribute('icon-before'))->insert($this->view->literal($content));
         return $fieldsetWidget;
     }
     return $content;
 }
开发者ID:SystemEd-Jacob,项目名称:nethgui,代码行数:19,代码来源:ObjectPicker.php


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