public addWidget ( SimpleWidget $tag ) | ||
$tag | SimpleWidget | Input tag to add. |
public function addWidget($tag)
{
if (strtolower($tag->getAttribute('type')) === 'submit') {
$this->buttons[] = $tag;
} elseif (strtolower($tag->getAttribute('type')) === 'image') {
$this->images[] = $tag;
} elseif ($tag->getName()) {
$this->setWidget($tag);
}
}
function testPost() { $form = new SimpleForm(new SimpleFormTag(array('method' => 'post')), $this->page('C:\\Users\\Garen\\Documents\\CS580\\Recipes\\RecipesInLaravel\\public\\testtt.html')); $select = new SimpleSelectionTag(array('name' => 'a')); $select->addTag(new SimpleOptionTag(array('value' => 'aaa', 'selected' => ''))); $form->addWidget($select); $this->assertIdentical($form->submit(), new SimplePostEncoding(array('a' => 'aaa'))); }