Refactored structure
This commit is contained in:
parent
963225382c
commit
e5164ae1dd
329 changed files with 277 additions and 457 deletions
44
src/B8Framework/Form.php
Executable file
44
src/B8Framework/Form.php
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace b8;
|
||||
use b8\Form\FieldSet,
|
||||
b8\View;
|
||||
|
||||
class Form extends FieldSet
|
||||
{
|
||||
protected $_action = '';
|
||||
protected $_method = 'POST';
|
||||
|
||||
public function getAction()
|
||||
{
|
||||
return $this->_action;
|
||||
}
|
||||
|
||||
public function setAction($action)
|
||||
{
|
||||
$this->_action = $action;
|
||||
}
|
||||
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->_method;
|
||||
}
|
||||
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->_method = $method;
|
||||
}
|
||||
|
||||
protected function _onPreRender(View &$view)
|
||||
{
|
||||
$view->action = $this->getAction();
|
||||
$view->method = $this->getMethod();
|
||||
|
||||
parent::_onPreRender($view);
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->render();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue