- Fixed UiSelect's selected item method

- Added a new DateTime (WIP from firefox still)
This commit is contained in:
Dave Mc Nicoll committed 2020-01-31 16:37:17 -05:00
1 parent e2c1c7ac39
commit cb2caf895e
5 files changed
+59 -9

No files matched your search

+8 -3
View File
@@ -23,7 +23,7 @@ class UiForm extends UiElement implements Extension {
{
switch($token) {
case 'ui.endform':
return ( new UiHidden() )->attributes([ 'name' =>"picea-csrf-protection", 'value' => "abcdefg" ])->render() . "</form>";
return "</form>";
case "ui.form.get":
$method = "get";
@@ -49,13 +49,18 @@ class UiForm extends UiElement implements Extension {
$method ??= $this->defaultMethod;
return "<?php echo ( new \\" . static::class . "() )->buildHtml('$method', $arguments) ?>";
}
public function buildHtml(string $method, string $action, array $attributes = []) : string
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" ]) );
}
return $this->render() . PHP_EOL;
}
}