tournasdim
4/5/2014 - 7:34 PM

gistfile1.php

<?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:',
			)
		));
	}
}