本文整理汇总了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();
}
示例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;
}