Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Attributes\Form;
- use Zend\Form\Form;
- use Zend\Hydrator\Reflection as ReflectionHydrator;
- use Attributes\Model\EavAttribute;
- class AddAttribute extends Form
- {
- public function __construct($name = null, $options = array()){
- parent::__construct($name, $options);
- $this->setHydrator(new ReflectionHydrator());
- $this->setObject(new EavAttribute());
- }
- public function init(){
- $this->add([
- 'name'=>'EavAttribute',
- 'type'=>AttributeFieldset::class, //service name from module.config.php
- ]);
- $this->add([
- 'name' => 'submit',
- 'attributes' => [
- 'type' => 'submit',
- 'value' => 'Save',
- 'class' => 'btn btn-primary',
- ],
- ]);
- }
- }
Add Comment
Please, Sign In to add comment