- Added multi-part by default to forms
- Fixed some bug within FormContext and FormHandler.
This commit is contained in:
1 parent
50d95defee
commit
657ceb2863
5 files changed
+8
-11
No files matched your search
+1
-3
@@ -29,8 +29,6 @@ class Form implements Extension {
|
||||
|
||||
public function register(Context $context) : void
|
||||
{
|
||||
$this->formContext = new FormContext($this->request);
|
||||
|
||||
$context->pushFunction("form", [ $this, 'formClass' ]);
|
||||
}
|
||||
|
||||
@@ -52,6 +50,6 @@ class Form implements Extension {
|
||||
|
||||
public function formClass(FormInterface $form, ? FormContext $formContext = null) : FormHandler
|
||||
{
|
||||
return new FormHandler($this->request, $form, $formContext ?: $this->formContext);
|
||||
return new FormHandler($this->request, $form, $formContext ?? $this->formContext ?? null);
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,6 @@ class FormContext implements FormContextInterface
|
||||
|
||||
public ? ResponseInterface $response = null;
|
||||
|
||||
protected int $action;
|
||||
|
||||
public function __construct(ServerRequestInterface $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
@@ -68,7 +66,7 @@ class FormContext implements FormContextInterface
|
||||
|
||||
public function set(string $key, $value)
|
||||
{
|
||||
return $_SESSION[$key] = $value;
|
||||
return $this->values[$key] = $value;
|
||||
}
|
||||
|
||||
public function delete(string $key) : void
|
||||
|
||||
@@ -5,8 +5,6 @@ namespace Picea\Ui\Method;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class FormHandler {
|
||||
# return new class($this->request, new FormContext(), $form) {
|
||||
|
||||
public bool $sent = false;
|
||||
|
||||
public FormContext $context;
|
||||
|
||||
Reference in new issue
Block a user