public function __construct(Values $values, Company $company) { $this->company = $company; parent::__construct(strtolower(str_replace('\\', '-', get_class($this)))); $this->setAttribute('method', 'post'); $this->add(array('name' => 'person-ssn', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => '000000-0000', 'required' => 'required'), 'options' => array('label' => 'Kennitala'))); $this->add(array('name' => 'person-address', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Ónefndgata 101', 'required' => 'required'), 'options' => array('label' => 'Heimilisfang'))); $this->add(array('name' => 'person-zip', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('placeholder' => 'Póstfang fyrirtækis.', 'required' => 'required'), 'options' => array('label' => 'Póstfang fyrirtækis', 'empty_option' => 'Veldu póstfang', 'value_options' => $values->getPostalCode()))); $this->add(array('name' => 'submit-individual', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Submit'), 'options' => array('label' => 'Submit'))); }
public function __construct(Values $values, User $user) { $this->user = $user; parent::__construct(strtolower(str_replace('\\', '-', get_class($this)))); $this->setAttribute('method', 'post'); $this->add(array('name' => 'name', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Nafn...', 'required' => 'required'), 'options' => array('label' => 'Nafn'))); $this->add(array('name' => 'email', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Netfang.', 'required' => 'required'), 'options' => array('label' => 'Netfang'))); $this->add(array('name' => 'title', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('placeholder' => 'Titill'), 'options' => array('label' => 'Titill', 'empty_option' => 'Veldu starfstitil', 'value_options' => $values->getTitles()))); $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Submit'), 'options' => array('label' => 'Submit'))); }
public function __construct(Values $values, CompanyService $company = null) { $this->company = $company; $this->values = $values; parent::__construct(strtolower(str_replace('\\', '-', get_class($this)))); $this->setAttribute('method', 'post'); $this->add(['name' => 'name', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => ['placeholder' => 'Nafn...', 'required' => 'required'], 'options' => ['label' => 'Nafn']]); $this->add(['name' => 'ssn', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => ['placeholder' => '000000-0000', 'required' => 'required'], 'options' => ['label' => 'Kennitala']]); $this->add(['name' => 'address', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => ['placeholder' => 'Heimilisfang...', 'required' => 'required'], 'options' => ['label' => 'Heimilisfang']]); $this->add(['name' => 'zip', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => ['required' => 'required'], 'options' => ['label' => 'Póstfang', 'value_options' => $values->getPostalCode()]]); $this->add(['name' => 'business_type', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => ['required' => 'required'], 'options' => ['label' => 'Rekstrarform', 'value_options' => $values->getBusinessTypes()]]); $this->add(['name' => 'number_of_employees', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => ['required' => 'required'], 'options' => ['label' => 'Starfsmannafjöldi', 'value_options' => $values->getCompanySizes()]]); $this->add(['name' => 'website', 'type' => 'Zend\\Form\\Element\\Url', 'attributes' => ['placeholder' => 'http://'], 'options' => ['label' => 'Heimasíða']]); $this->add(['name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => ['value' => 'Submit'], 'options' => ['label' => 'Submit']]); }
public function __construct(Values $values, Company $company) { $this->values = $values; $this->company = $company; parent::__construct(strtolower(str_replace('\\', '-', get_class($this)))); $this->setAttribute('method', 'post'); $this->add(array('name' => 'company-name', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Nafn.', 'required' => 'required'), 'options' => array('label' => 'Nafn'))); $this->add(array('name' => 'company-ssn', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => '000000-0000', 'required' => 'required'), 'options' => array('label' => 'Kennitala'))); $this->add(array('name' => 'company-address', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Ónefndgata 101', 'required' => 'required'), 'options' => array('label' => 'Heimilisfang'))); $this->add(array('name' => 'company-zip', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('placeholder' => 'Póstfang fyrirtækis.', 'required' => 'required'), 'options' => array('label' => 'Póstfang', 'empty_option' => 'Veldu póstfang', 'value_options' => $values->getPostalCode()))); $this->add(array('name' => 'company-web', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'http://www.'), 'options' => array('label' => 'Heimasíða'))); $this->add(array('name' => 'company-size', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('placeholder' => 'Fjöldi starfsmanna', 'required' => 'required'), 'options' => array('label' => 'Fjöldi starfsmanna', 'empty_option' => 'Veldu fjölda', 'value_options' => $values->getCompanySizes()))); $this->add(array('name' => 'company-type', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('placeholder' => 'Rekstrarfyrirkomulag', 'required' => 'required'), 'options' => array('label' => 'Rekstrarfyrirkomulag', 'empty_option' => 'Veldu rekstrarfyrirkomulag', 'value_options' => $values->getBusinessTypes()))); $this->add(array('name' => 'submit-company-create', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Submit'), 'options' => array('label' => 'Submit'))); }
public function testCreate() { $service = new Values(); $this->assertInternalType('array', $service->getBusinessTypes()); $this->assertInternalType('array', $service->getPostalCode()); $this->assertInternalType('array', $service->getCompanySizes()); $this->assertInternalType('array', $service->getTitles()); $eventManager = new EventManager(); $this->assertNotEquals($eventManager, $service->getEventManager()); $service->setEventManager($eventManager); $this->assertEquals($eventManager, $service->getEventManager()); }