getField() public method

Get a single field from $initFieldsValues
public getField ( $name ) : array
$name
return array
Ejemplo n.º 1
0
 public function testGetAndSetField()
 {
     $fields = array('username' => array('type' => 'text', 'value' => 'Username here...', 'label' => 'Username:'******'required' => true, 'attributes' => array('size' => 40)), 'submit' => array('type' => 'submit', 'value' => 'SUBMIT'));
     $f = new Form('/submit', 'post', $fields);
     $submit = $f->getField('submit');
     $this->assertEquals('SUBMIT', $submit['value']);
     $submit['value'] = 'NEW SUBMIT';
     $f->setField('submit', $submit);
     $submit = $f->getField('submit');
     $this->assertEquals('NEW SUBMIT', $submit['value']);
 }