本文整理汇总了PHP中Zend\Form\Fieldset::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Fieldset::get方法的具体用法?PHP Fieldset::get怎么用?PHP Fieldset::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Fieldset
的用法示例。
在下文中一共展示了Fieldset::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFieldset
/** {@inheritdoc} */
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
{
$output = '';
if ($fieldset->has('Groups')) {
$groups = $fieldset->get('Groups');
if ($groups->count()) {
$output = "<div>\n";
foreach ($groups as $element) {
if ($element instanceof \Zend\Form\Element\Radio) {
$label = $view->htmlTag('a', $view->escapeHtml($element->getLabel()), array('href' => $view->consoleUrl('group', 'general', array('name' => $element->getLabel()))));
$output .= $view->htmlTag('fieldset', "<legend>{$label}</legend>\n" . $view->formRadio($element));
}
}
$output .= $view->formRow($fieldset->get('Submit'));
$output .= "\n</div>\n";
}
}
return $output;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: renderFieldset
/** {@inheritdoc} */
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
{
$output = "<div class='table'>\n";
$output .= "<fieldset><legend><span>What to save</span></legend>\n";
$output .= $view->formRow($fieldset->get('What'));
$output .= "</fieldset>\n";
$output .= "<fieldset><legend><span>Where to save</span></legend>\n";
$output .= $view->formRow($fieldset->get('Where'));
foreach (array('NewGroup', 'Description') as $name) {
$element = $fieldset->get($name);
$output .= $view->formRow($element, null, false);
$output .= $view->formElementErrors($element, array('class' => 'error'));
}
$output .= $view->formRow($fieldset->get('ExistingGroup'));
$output .= "</fieldset>\n";
$output .= $view->formRow($fieldset->get('Submit'));
$output .= "</div>\n";
return $output;
}
示例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;
}
示例7: renderFieldset
/** {@inheritdoc} */
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
{
$output = $view->htmlTag('div', $view->formRow($fieldset->get('DeleteInterfaces'), 'append'));
$output .= $view->htmlTag('div', $view->formRow($fieldset->get('yes')) . $view->formRow($fieldset->get('no')));
return $output;
}