Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created September 27, 2012 08:50
Show Gist options
  • Save bakura10/3792956 to your computer and use it in GitHub Desktop.
Save bakura10/3792956 to your computer and use it in GitHub Desktop.
Form
<?php
namespace User\Form;
use Common\Registry\Registry;
use DoctrineORMModule\Stdlib\Hydrator\DoctrineEntity as DoctrineHydrator;
use Zend\Stdlib\Hydrator\ClassMethods as ClassMethodsHydrator;
class Student extends AbstractUser
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->setHydrator(new DoctrineHydrator(Registry::get('EntityManager')));
$this->add(array(
'type' => 'User\Form\StudentProfile',
'name' => 'profile',
'options' => array(
'label' => 'Profil'
)
));
$this->add(array(
'type' => 'Zend\Form\Element\Collection',
'name' => 'skills',
'options' => array(
'count' => 1,
'allow_add' => true,
'allow_remove' => true,
'should_create_template' => true,
'target_element' => array(
'type' => 'User\Form\StudentSkill'
)
)
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment