removeElement() public method

Remove a form element
public removeElement ( string $elementName )
$elementName string
示例#1
0
 public function testRemoveElements()
 {
     $e = new Element('text', 'username', 'Username');
     $c = new Checkbox('colors', array('Red', 'Green', 'Blue'));
     $r = new Radio('colors', array('Red', 'Green', 'Blue'));
     $f = new Form('/submit', 'post');
     $f->addElements(array($e, $c, $r));
     $f->removeElement('username');
     $f->removeElement('colors');
     $this->assertEquals(1, count($f->getFields()));
 }