'ui-form', ]; public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) : string { switch($token) { case 'ui.endform': return ""; case "ui.form.get": $method = "get"; break; case "ui.form.patch": $method = "patch"; break; case "ui.form.delete": $method = "delete"; break; case "ui.form.put": $method = "put"; break; case "ui.form.post": $method = "post"; break; } $method ??= $this->defaultMethod; return "buildHtml('$method', $arguments) ?>"; } public function buildHtml(string $method = "get", string $action = "", array $attributes = []) : string { $method = strtolower($method); $this->option('tag-type', 'single'); $this->attributes([ 'method' => $method, 'action' => $action ] + $attributes); if ( $method !== "get" ) { $this->append( ( new UiHidden() )->attributes([ 'name' =>"picea-csrf-protection", 'value' => "abcdefg" ]) ); $this->attributes([ 'enctype' => "multipart/form-data" ]); } return $this->render() . PHP_EOL; } }