Created
June 27, 2013 16:59
-
-
Save Ulv/5878207 to your computer and use it in GitHub Desktop.
объект form. Содержит спарсенные данные html формы
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Class form | |
* just a container | |
*/ | |
class form implements IteratorAggregate | |
{ | |
private $_formAction; | |
private $_formMethod; | |
private $_inputs; | |
function __construct($_formAction, $_formMethod) | |
{ | |
$this->_formAction = $_formAction; | |
$this->_formMethod = strtoupper($_formMethod); | |
$this->_inputs = array(); | |
} | |
/** | |
* @param $field | |
*/ | |
public function addField($field) | |
{ | |
if (! empty($field)) { | |
$this->_inputs[] = $field; | |
} | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getFormAction() | |
{ | |
return $this->_formAction; | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getFormMethod() | |
{ | |
return $this->_formMethod; | |
} | |
public function getIterator() | |
{ | |
return new ArrayIterator($this->_inputs); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment