Gc\Form\AbstractForm::getValue PHP Method

getValue() public method

Return element value
public getValue ( string $name = null ) : string
$name string Name
return string
    public function getValue($name = null)
    {
        if ($this->has($name)) {
            return $this->get($name)->getValue();
        }
        return null;
    }

Usage Example

Beispiel #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetValue()
 {
     $this->assertNull($this->object->getValue('undefined'));
     $element = new Element\Text('text');
     $element->setValue('string');
     $this->object->add($element);
     $this->assertEquals('string', $this->object->getValue('text'));
 }