Skip to content

Commit 8476f2d

Browse files
authored
chore: cleanup form enctype (#524)
1 parent 7c4f12d commit 8476f2d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/Tempest/View/src/Components/Form.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,11 @@ 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-
2318
public function render(GenericElement $element, ViewRenderer $renderer): string
2419
{
2520
$action = $element->getAttribute('action');
2621
$method = $element->getAttribute('method') ?? 'post';
27-
$enctype = $this->isMultipart($element)
28-
? "enctype=\"{$element->getAttribute('enctype')}\""
29-
: '';
22+
$enctype = $element->hasAttribute('enctype') ? sprintf('enctype="%s"', $element->getAttribute('enctype')) : '';
3023

3124
return <<<HTML
3225
<form action="{$action}" method="{$method}" {$enctype}>

0 commit comments

Comments
 (0)