Skip to content

Instantly share code, notes, and snippets.

@tournasdim
Forked from michael-romer/gist:3924047
Created April 5, 2014 19:34
Show Gist options
  • Save tournasdim/9996981 to your computer and use it in GitHub Desktop.
Save tournasdim/9996981 to your computer and use it in GitHub Desktop.
<?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