Created
September 27, 2012 08:50
-
-
Save bakura10/3792956 to your computer and use it in GitHub Desktop.
Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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