| Total Complexity | 6 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Form extends Container |
||
| 9 | { |
||
| 10 | protected $submitValues = array('Submit'); |
||
| 11 | protected $showSubmit = true; |
||
| 12 | protected $method = "POST"; |
||
| 13 | private $action; |
||
| 14 | |||
| 15 | public function __construct() |
||
| 16 | { |
||
| 17 | $this->action = filter_var($_SERVER["REQUEST_URI"], FILTER_VALIDATE_URL); |
||
| 18 | } |
||
| 19 | |||
| 20 | public function setAction($action) |
||
| 21 | { |
||
| 22 | $this->action = $action; |
||
| 23 | return $this; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function renderHead() |
||
| 27 | { |
||
| 28 | $this->setAttribute("method", $this->method); |
||
| 29 | $this->setAttribute('action', $this->action); |
||
| 30 | $this->setAttribute('accept-charset', 'utf-8'); |
||
| 31 | |||
| 32 | return $this->templateRenderer->render('form_head', ['element' => $this]); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function renderFoot() |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function setShowSubmit($showSubmit) |
||
| 43 | { |
||
| 44 | $this->showSubmit = $showSubmit; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function setSubmitValues($submitValues) |
||
| 50 | } |
||
| 51 | } |
||
| 52 |