Skip to content

Instantly share code, notes, and snippets.

@michael-romer
Created October 20, 2012 17:08
Show Gist options
  • Save michael-romer/3924047 to your computer and use it in GitHub Desktop.
Save michael-romer/3924047 to your computer and use it in GitHub Desktop.
Listing 16.23
<?php
namespace Helloworld\Form;
use Zend\Form\Fieldset;
class UserAddressFieldset extends Fieldset
{
public function __construct()
{
parent::__construct('userAddress');
$this->setHydrator(new \Zend\Stdlib\Hydrator\Reflection());
$this->setObject(new \Helloworld\Entity\UserAddress());
$this->add(array(
'name' => 'street',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Ihre Strasse:',
)
));
$this->add(array(
'name' => 'streetNumber',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Ihre Hausnummer:',
)
));
$this->add(array(
'name' => 'zipcode',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Ihre Postleitzahl:',
)
));
$this->add(array(
'name' => 'city',
'attributes' => array(
'type' => 'text',
),
'options' => array(
'label' => 'Ihre Stadt:',
)
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment