- Corrected inputs handling from view to compiled states

- Added UiSelect widget
- Fixed UiForm widget
- Fixed UiInput widget
- Added mocks of UiMessage and UiPopup. Not even a WIP at this stage.
This commit is contained in:
mcndave committed 2019-11-01 14:47:54 -04:00
1 parent 4bf08def27
commit f28ace745d
7 files changed
+153 -27

No files matched your search

+7 -6
View File
@@ -19,14 +19,15 @@ class UiInput extends UiElement implements Extension {
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) : string
{
list($name, $value, $options) = array_pad(explode(',', $arguments), 3, null);
$this->attributes['name'] = $this->trim($name);
$this->setValue($this->trim($value));
$this->attributes($this->parseOptions($options));
return $this->render();
return "<?php echo ( new \\" . static::class . "() )->buildHtml($arguments) ?>";
}
public function buildHtml(string $name, string $value, array $attributes = []) : string
{
$this->setValue($value);
$this->attributes([ 'name' => $name ] + $attributes + $this->attributes);
return $this->render();
}
protected function setValue($value) : void
{