diff --git a/src/Form/UiForm.php b/src/Form/UiForm.php index 546a730..97507e2 100644 --- a/src/Form/UiForm.php +++ b/src/Form/UiForm.php @@ -68,7 +68,8 @@ class UiForm extends UiElement implements Extension { public function buildHtml(string $method = "get", string $name = "", string $action = "", array $attributes = []) : string { - $method = strtolower($method); + # Method passed in arguments take precedents over options + $method = strtolower($attributes['method'] ?? $method); $this->option('tag-type', 'single'); @@ -77,8 +78,8 @@ class UiForm extends UiElement implements Extension { unset($this->attributes['class']); } - $this->attributes([ 'method' => $method, 'action' => $action ] + $attributes); - + $this->attributes([ 'action' => $action, 'method' => $method, ] + $attributes); + if ( $method !== "get" ) { if ($this->csrf) { diff --git a/src/Method/FormContext.php b/src/Method/FormContext.php index a048490..a08d86d 100644 --- a/src/Method/FormContext.php +++ b/src/Method/FormContext.php @@ -73,7 +73,7 @@ class FormContext implements FormContextInterface public function executed() : bool { - return $this->formExecuted; + return $this->formExecutionStatus === false ? false : $this->formExecuted; } public function formSent() : bool