本文整理汇总了PHP中Form_Group::enableDuplication方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Group::enableDuplication方法的具体用法?PHP Form_Group::enableDuplication怎么用?PHP Form_Group::enableDuplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Group
的用法示例。
在下文中一共展示了Form_Group::enableDuplication方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createDestinationServerInputGroup
function createDestinationServerInputGroup($value = null)
{
$group = new Form_Group('Destination server');
$group->add(new Form_IpAddress('server', 'Destination server', $value))->setWidth(4)->setHelp('This is the IPv6 address of the server to which DHCPv6 requests are relayed.')->setIsRepeated();
$group->enableDuplication(null, true);
// Buttons are in-line with the input
return $group;
}
示例2: Form
$form = new Form(new Form_Button('Submit', gettext("Save")));
$section = new Form_Section('QinQ Configuration');
$section->addInput(new Form_Select('if', 'Parent interface', $pconfig['if'], build_parent_list()))->setHelp('Only QinQ capable interfaces will be shown.');
$section->addInput(new Form_Input('tag', 'First level tag', 'number', $pconfig['tag'], ['max' => '4094', 'min' => '1']))->setHelp('This is the first level VLAN tag. On top of this are stacked the member VLANs defined below.');
$section->addInput(new Form_Checkbox('autogroup', 'Option(s)', 'Adds interface to QinQ interface groups', $pconfig['autogroup']))->setHelp('Allows rules to be written more easily');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
$section->addInput(new Form_StaticText('Member(s)', 'You can specify ranges in the inputs below. Enter a range (2-3) or individual numbers.' . '<br />' . 'Click "Duplicate" as many times as needed to add new inputs'));
if (isset($id) && $a_qinqs[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$counter = 0;
$members = $pconfig['members'];
// List each of the member tags from the space-separated list
if ($members != "") {
$item = explode(" ", $members);
} else {
$item = array('');
}
foreach ($item as $ww) {
$member = $item[$counter];
$group = new Form_Group($counter == 0 ? 'Tag(s)' : '');
$group->add(new Form_Input('members', null, 'text', $ww))->setWidth(6);
// Width must be <= 8 to make room for the duplication buttons
$counter++;
$group->enableDuplication(null, true);
// Buttons are in-line with the input
$section->add($group);
}
$form->add($section);
print $form;
include "foot.inc";