File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Tempest/View/src/Components Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,21 @@ public static function getName(): string
1515 return 'x-form ' ;
1616 }
1717
18+ public function isMultipart (GenericElement $ element ): bool
19+ {
20+ return $ element ->hasAttribute ('enctype ' );
21+ }
22+
1823 public function render (GenericElement $ element , ViewRenderer $ renderer ): string
1924 {
2025 $ action = $ element ->getAttribute ('action ' );
2126 $ method = $ element ->getAttribute ('method ' ) ?? 'post ' ;
27+ $ enctype = $ this ->isMultipart ($ element )
28+ ? "enctype= \"{$ element ->getAttribute ('enctype ' )}\""
29+ : '' ;
2230
2331 return <<<HTML
24- <form action=" {$ action }" method=" {$ method }">
32+ <form action=" {$ action }" method=" {$ method }" { $ enctype } >
2533 <x-slot />
2634</form>
2735HTML ;
You can’t perform that action at this time.
0 commit comments