diff --git a/src/Method/Form.php b/src/Method/Form.php index fa48bb8..2d8ca66 100644 --- a/src/Method/Form.php +++ b/src/Method/Form.php @@ -32,8 +32,6 @@ class Form implements Extension { $this->formContext = new FormContext($this->request); $context->pushFunction("form", [ $this, 'formClass' ]); - - #$context-> } public function form_csrf(string $field, string $value) { @@ -52,7 +50,7 @@ class Form implements Extension { return $value; } - public function formClass(FormInterface $form, ? FormContext $formContext = null) + public function formClass(FormInterface $form, ? FormContext $formContext = null) : FormHandler { return new FormHandler($this->request, $form, $formContext ?: $this->formContext); } diff --git a/src/Method/FormContext.php b/src/Method/FormContext.php index efc0394..b4dd42c 100644 --- a/src/Method/FormContext.php +++ b/src/Method/FormContext.php @@ -17,6 +17,8 @@ class FormContext implements FormContextInterface public ? ResponseInterface $response = null; + protected int $action; + public function __construct(ServerRequestInterface $request) { $this->request = $request; diff --git a/src/Method/FormHandler.php b/src/Method/FormHandler.php index 4dc2027..00c5166 100644 --- a/src/Method/FormHandler.php +++ b/src/Method/FormHandler.php @@ -31,7 +31,7 @@ class FormHandler { if ( $this->sent ) { if ( $this->form->validate($this->context) ) { - $this->form->save($this->context); + $this->form->run($this->context); } } } diff --git a/src/Method/FormInterface.php b/src/Method/FormInterface.php index 0f5971f..15096f7 100644 --- a/src/Method/FormInterface.php +++ b/src/Method/FormInterface.php @@ -2,11 +2,11 @@ namespace Picea\Ui\Method; -interface FormInterface +interface FormInterface { public function initialize(FormContextInterface $context) : void; public function validate(FormContextInterface $context) : bool; - public function save(FormContextInterface $context) : void; + public function run(FormContextInterface $context) : void; } \ No newline at end of file