本文整理汇总了PHP中Zend\Form\Fieldset::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Fieldset::init方法的具体用法?PHP Fieldset::init怎么用?PHP Fieldset::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Fieldset
的用法示例。
在下文中一共展示了Fieldset::init方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @inheritdoc
*
* @throws \Zend\Form\Exception\InvalidArgumentException
*/
public function init()
{
parent::init();
$this->add(['name' => 'id', 'type' => 'hidden', 'options' => [], 'attributes' => array('value' => Uuid::uuid4()->toString(), 'class' => 'authUuid')]);
$this->add(['name' => 'description', 'options' => ['label' => 'Описание'], 'attributes' => ['class' => 'authDescription', 'placeholder' => 'Описание'], 'type' => 'text']);
$this->add(['name' => 'token', 'options' => ['label' => 'Токен'], 'attributes' => ['class' => 'authToken', 'placeholder' => 'Токен'], 'type' => 'text']);
$this->add(['name' => 'remove', 'options' => ['label' => 'Удалить'], 'attributes' => ['class' => 'deleteAuthItem'], 'type' => 'button']);
}
示例2: init
public function init()
{
parent::init();
$this->setHydrator(new ClassMethodsHydrator(false));
$this->setObject(new Project());
$this->add(['name' => 'name', 'type' => 'text', 'options' => ['label' => 'Name', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'defaultUnit', 'type' => 'Ajasta\\Core\\Form\\Element\\UnitSelect', 'options' => ['label' => 'Default unit', 'column-size' => 'sm-2']]);
$this->add(['name' => 'defaultUnitPrice', 'type' => 'number', 'options' => ['label' => 'Default unit price', 'column-size' => 'sm-2'], 'attributes' => ['min' => '0', 'step' => '0.01']]);
}
示例3: init
public function init()
{
parent::init();
$this->setHydrator(new DoctrineHydrator($this->getObjectManager()))->setObject(new Bubble());
$this->add(array('name' => 'title', 'type' => 'Text', 'options' => array('label' => gettext_noop('Title'), 'column-size' => 'sm-10', 'label_attributes' => array('class' => 'col-sm-2')), 'attributes' => array('id' => "")));
$this->add(array('name' => 'posX', 'type' => 'Number', 'options' => array('label' => gettext_noop('Pos X'), 'column-size' => 'sm-10', 'label_attributes' => array('class' => 'col-sm-2')), 'attributes' => array('id' => "", 'step' => '1')));
$this->add(array('name' => 'posY', 'type' => 'Number', 'options' => array('label' => gettext_noop('Pos Y'), 'column-size' => 'sm-10', 'label_attributes' => array('class' => 'col-sm-2')), 'attributes' => array('id' => "", 'step' => '1')));
$this->add(array('name' => 'priority', 'type' => 'Text', 'options' => array('label' => gettext_noop('Priority'), 'column-size' => 'sm-10', 'label_attributes' => array('class' => 'col-sm-2')), 'attributes' => array('id' => "")));
}
示例4: init
public function init()
{
parent::init();
$this->setHydrator(new ClassMethodsHydrator(false));
$this->setObject(new InvoiceItem());
$this->add(['name' => 'description', 'type' => 'text', 'options' => ['label' => 'Description', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'quantity', 'type' => 'number', 'options' => ['label' => 'Quantity', 'column-size' => 'sm-2'], 'attributes' => ['min' => '0', 'max' => '100', 'step' => '0.01', 'required' => true]]);
$this->add(['name' => 'unit', 'type' => 'Ajasta\\Core\\Form\\Element\\UnitSelect', 'options' => ['label' => 'Unit', 'column-size' => 'sm-2']]);
$this->add(['name' => 'unitPrice', 'type' => 'number', 'options' => ['label' => 'Unit price', 'column-size' => 'sm-2'], 'attributes' => ['min' => '0', 'step' => '0.01', 'required' => true]]);
}
示例5: init
/**
* @inheritdoc
*
* @throws \Zend\Form\Exception\InvalidArgumentException
*/
public function init()
{
parent::init();
$this->add(['name' => 'id', 'type' => 'hidden', 'attributes' => ['value' => Uuid::uuid4()->toString()]], ['priority' => 5000]);
$this->add(['name' => 'name', 'options' => ['label' => 'Имя гитлаба'], 'type' => 'text'], ['priority' => 4000]);
$this->add(['name' => 'url', 'options' => ['label' => 'Урл гитлаба'], 'type' => 'text'], ['priority' => 3000]);
$this->add(['name' => 'description', 'options' => ['label' => 'Описание гитлаба'], 'type' => 'text'], ['priority' => 2000]);
$this->add(['name' => 'auth', 'options' => ['label' => 'Основной способ авторизации'], 'type' => Select::class], ['priority' => 1500]);
$this->add(['name' => 'authData', 'type' => 'collection', 'attributes' => ['class' => 'authDataCollection'], 'options' => ['label' => 'Способы авторизации', 'should_create_template' => true, 'allow_add' => true, 'allow_remove' => true, 'twb-layout' => 'inline', 'target_element' => ['type' => AuthFieldset::class, 'hydrator' => ['type' => Hydrator\ClassMethodsHydrator::class, 'options' => ['excluded_methods' => ['getInputFilterSpecification', 'getHydrator', 'getArrayCopy', 'getInputFilter']]]]]], ['priority' => 1000]);
$this->add(['name' => 'addAuthData', 'type' => Element\Button::class, 'options' => ['label' => 'Добавить']], ['priority' => 500]);
}
示例6: init
public function init()
{
parent::init();
$this->setHydrator(new DoctrineHydrator($this->getObjectManager()))->setObject(new Edge());
$this->add(array('name' => 'from', 'type' => ObjectSelect::class, 'options' => array('object_manager' => $this->getObjectManager(), 'target_class' => Bubble::class, 'label_generator' => function ($item) {
$o = $item->getOwner();
return $item->getTitle() . ' (' . ($o ? $o->getDisplayName() : '') . ')';
}, 'display_empty_item' => true, 'empty_item_label' => gettext_noop('-- Bubble From --'), 'label' => gettext_noop('Bubble From'), 'column-size' => 'sm-10', 'label_attributes' => array('class' => 'col-sm-2')), 'attributes' => array('id' => "")));
$this->add(array('name' => 'to', 'type' => ObjectSelect::class, 'options' => array('object_manager' => $this->getObjectManager(), 'target_class' => Bubble::class, 'label_generator' => function ($item) {
$o = $item->getOwner();
return '(' . $item->getId() . ')' . $item->getTitle() . ' (' . ($o ? $o->getDisplayName() : '') . ')';
}, 'display_empty_item' => true, 'empty_item_label' => gettext_noop('-- Bubble to --'), 'label' => gettext_noop('Bubble to'), 'column-size' => 'sm-10', 'label_attributes' => array('class' => 'col-sm-2')), 'attributes' => array('id' => "")));
}
示例7: init
public function init()
{
parent::init();
$this->setHydrator(new ClassMethodsHydrator(false));
$this->setObject(new Client());
$this->add(['name' => 'name', 'type' => 'text', 'options' => ['label' => 'Name', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'locale', 'type' => 'Ajasta\\Core\\Form\\Element\\LocaleSelect', 'options' => ['label' => 'Language', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'currencyCode', 'type' => 'Ajasta\\Core\\Form\\Element\\CurrencySelect', 'options' => ['label' => 'Currency', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'taxable', 'type' => 'Ajasta\\Core\\Form\\Element\\Toggle', 'options' => ['label' => 'Taxable', 'column-size' => 'sm-4']]);
$this->add(['name' => 'defaultUnit', 'type' => 'Ajasta\\Core\\Form\\Element\\UnitSelect', 'options' => ['label' => 'Default unit', 'column-size' => 'sm-2']]);
$this->add(['name' => 'defaultUnitPrice', 'type' => 'number', 'options' => ['label' => 'Default unit price', 'column-size' => 'sm-2'], 'attributes' => ['min' => '0', 'step' => '0.01']]);
$this->add(['type' => 'Ajasta\\Address\\Form\\AddressFieldset', 'name' => 'address', 'options' => ['label' => 'Address']]);
}
示例8: init
public function init()
{
parent::init();
$this->setObject(new Invoice());
$this->add(['name' => 'client', 'type' => 'Ajasta\\Client\\Form\\Element\\ClientSelect', 'options' => ['label' => 'Client', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'project', 'type' => 'select', 'options' => ['label' => 'Project', 'column-size' => 'sm-4']]);
$this->add(['name' => 'locale', 'type' => 'Ajasta\\Core\\Form\\Element\\LocaleSelect', 'options' => ['label' => 'Language', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'currencyCode', 'type' => 'Ajasta\\Core\\Form\\Element\\CurrencySelect', 'options' => ['label' => 'Currency', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
$this->add(['name' => 'issueDate', 'type' => 'Ajasta\\Core\\Form\\Element\\DatePicker', 'options' => ['label' => 'Issue date', 'column-size' => 'sm-3', 'default-today' => true], 'attributes' => ['required' => true]]);
$this->add(['name' => 'dueDate', 'type' => 'Ajasta\\Core\\Form\\Element\\DatePicker', 'options' => ['label' => 'Due date', 'column-size' => 'sm-3']]);
$this->add(['name' => 'discount', 'type' => 'number', 'options' => ['label' => 'Discount', 'column-size' => 'sm-2', 'add-on-append' => '%'], 'attributes' => ['min' => '0', 'max' => '100', 'step' => '0.01']]);
$this->add(['name' => 'vat', 'type' => 'number', 'options' => ['label' => 'VAT', 'column-size' => 'sm-2', 'add-on-append' => '%'], 'attributes' => ['min' => '0', 'max' => '100', 'step' => '0.01']]);
$this->add(['name' => 'items', 'type' => 'collection', 'options' => ['label' => 'Items', 'count' => 1, 'should_create_template' => true, 'target_element' => ['type' => 'Ajasta\\Invoice\\Form\\InvoiceItemFieldset']], 'attributes' => ['id' => 'invoiceItems']]);
}
示例9: init
public function init()
{
parent::init();
$this->setObject(new Address());
$this->add(['name' => 'recipient', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Recipient', 'column-size' => 'sm-4']]);
$this->add(['name' => 'organization', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Organization', 'column-size' => 'sm-4']]);
$this->add(['name' => 'addressLine1', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Address line 1', 'column-size' => 'sm-4']]);
$this->add(['name' => 'addressLine2', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Address line 2', 'column-size' => 'sm-4']]);
$this->add(['name' => 'locality', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Locality', 'column-size' => 'sm-4']]);
$this->add(['name' => 'dependentLocality', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Dependent locality', 'column-size' => 'sm-4']]);
$this->add(['name' => 'administrativeArea', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Administrative area', 'column-size' => 'sm-4']]);
$this->add(['name' => 'postalCode', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Postal code', 'column-size' => 'sm-2']]);
$this->add(['name' => 'sortingCode', 'type' => 'Ajasta\\Address\\Form\\Element\\AddressField', 'options' => ['label' => 'Sorting code', 'column-size' => 'sm-2']]);
$this->add(['name' => 'countryCode', 'type' => 'Ajasta\\Address\\Form\\Element\\CountrySelect', 'options' => ['label' => 'Country', 'column-size' => 'sm-4'], 'attributes' => ['required' => true]]);
}
示例10: init
/**
* @inheritdoc
*
* @throws \Zend\Form\Exception\InvalidArgumentException
*/
public function init()
{
parent::init();
$this->add(['name' => 'id', 'type' => 'hidden', 'attributes' => ['value' => Uuid::uuid4()->toString()]], ['priority' => 5000]);
$this->add(['name' => 'name', 'options' => ['label' => 'Имя очета'], 'type' => 'text'], ['priority' => 4000]);
$this->add(['name' => 'description', 'options' => ['label' => 'Описание отчета'], 'type' => 'text'], ['priority' => 2000]);
// $gitLabsValueOptions = $this->getGitLabs();
// $gitLabSpec = [
// 'name' => 'gitLabId',
// 'options' => [
// 'label' => 'Используемый гитлаб',
// 'value_options' => $gitLabsValueOptions
// ],
// 'type' => Element\Select::class,
// ];
// if (0 !== count($gitLabsValueOptions)) {
// reset($gitLabsValueOptions);
// $gitLabSpec['options']['value'] = key($gitLabsValueOptions);
// }
// $this->add($gitLabSpec, [
// 'priority' => 1500
// ]);
$this->add(['name' => 'gitLabId', 'options' => ['label' => 'Используемый гитлаб', 'value_options' => $this->getGitLabs()], 'type' => Element\Select::class], ['priority' => 1500]);
}