Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct('address');
     $this->setHydrator(new ClassMethodsHydrator(false))->setObject(new Entity\Address());
     $street = new \Zend\Form\Element('street', array('label' => 'Street'));
     $street->setAttribute('type', 'text');
     $city = new CityFieldset();
     $city->setLabel('City');
     $this->add($street);
     $this->add($city);
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct('address');
     $this->setHydrator(new ClassMethodsHydrator(false))->setObject(new Entity\Address());
     $street = new \Zend\Form\Element('street', array('label' => 'Street'));
     $street->setAttribute('type', 'text');
     $city = new CityFieldset();
     $city->setLabel('City');
     $this->add($street);
     $this->add($city);
     $phones = new \Zend\Form\Element\Collection('phones');
     $phones->setLabel('Phone numbers')->setOptions(array('count' => 2, 'allow_add' => true, 'allow_remove' => true, 'target_element' => new PhoneFieldset()));
     $this->add($phones);
 }