Skip to content

Instantly share code, notes, and snippets.

@Goram
Last active December 23, 2015 04:18
Show Gist options
  • Save Goram/6578877 to your computer and use it in GitHub Desktop.
Save Goram/6578877 to your computer and use it in GitHub Desktop.
<?php
$factory = new Factory();
$form = $factory->createForm(array(
'input_filter' => $inputFilter,
'fieldsets' => array(
array(
'spec' => array(
'name' => 'user',
'hydrator' => $hydrator,
'options' => array(
'label' => 'Benutzer ändern',
'use_as_base_fieldset' => true,
),
'elements' => array(
array(
'spec' => array(
'name' => 'username',
'type' => 'Text',
'options' => array(
'label' => 'Benutzername*:'
),
'attributes' => array(
'maxlength' => 255
)
)
),
array(
'spec' => array(
'name' => 'email',
'type' => 'Text',
'options' => array(
'label' => 'E-Mail*:'
),
'attributes' => array(
'maxlength' => 128
)
)
),
array(
'spec' => array(
'name' => 'email2',
'type' => 'Text',
'options' => array(
'label' => 'E-Mail wiederholen*:'
),
'attributes' => array(
'maxlength' => 128
)
)
),
array(
'spec' => array(
'name' => 'initialpassword',
'type' => 'Text',
'options' => array(
'label' => 'Initial-Passwort:'
),
'attributes' => array(
'maxlength' => 128
)
)
),
array(
'spec' => array(
'name' => 'role',
'type' => 'Select',
'options' => array(
'label' => 'Rolle*:',
'value_options' => $roleValueOptions
)
)
),
array(
'spec' => array(
'name' => 'isParentUser',
'type' => 'Select',
'options' => array(
'label' => 'Darf Benutzer anlegen',
'value_options' => array(
'false' => 'Nein',
'true' => 'Ja'
)
)
)
),
array(
'spec' => array(
'name' => 'parentUserId',
'type' => 'Select',
'options' => array(
'label' => 'Übergeordneter Benutzer:',
'value_options' => $parentUserIdValueOptions
)
)
),
)
)
)
),
'elements' => array(
array(
'spec' => array(
'name' => 'submit',
'type' => 'Submit',
'attributes' => array(
'value' => 'Speichern'
)
)
),
)
));
-----------------------------
$form->setBaseFieldset($form->get('user'));
$form->setHydrator($hydrator);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment