示例#1
0
 public function testHandleRequest()
 {
     $element = new TextArea();
     $element->setName('test');
     $element->handle(new FormData('post', ['test' => 'test text']));
     $this->assertEquals('test text', $element->getValue());
     $element->handle(new FormData('post', []));
     $this->assertNull($element->getValue());
 }
示例#2
0
文件: Form.php 项目: sevikerr/form
 /**
  * @param string $name
  * @param null $text
  * @return TextArea
  */
 public function textarea($name, $text = null)
 {
     $input = new TextArea();
     $input->setName($name);
     $input->setText($text);
     $this->addElement($input);
     return $input;
 }