Fixed 'img' tags, removed utf8_encode since it's deprecated and readded echoRaw from textarea widget
This commit is contained in:
parent
ea780c697e
commit
fd4e30bd42
|
@ -11,8 +11,6 @@ class UiImage extends UiElement implements Extension {
|
|||
|
||||
public array $tokens = [ "ui:img", "ui:image" ];
|
||||
|
||||
public string $tag = "img";
|
||||
|
||||
public array $attributes = [
|
||||
'class' => 'ui-image',
|
||||
];
|
||||
|
@ -21,6 +19,10 @@ class UiImage extends UiElement implements Extension {
|
|||
'tag-type' => "single",
|
||||
];
|
||||
|
||||
public function __construct(
|
||||
public string $tag = "img",
|
||||
) {}
|
||||
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token, array $options = []) : string
|
||||
{
|
||||
return "<?php echo ( new \\" . static::class . "() )->buildHtml($arguments) ?>";
|
||||
|
|
|
@ -25,9 +25,15 @@ class UiTextarea extends UiInput {
|
|||
|
||||
return "<?php echo ( new \\" . static::class . "(raw: $raw) )->buildHtml($arguments) ?>";
|
||||
}
|
||||
|
||||
protected function setValue($value) : void
|
||||
{
|
||||
$this->echoRaw ? $this->html($value) : $this->text($value);
|
||||
}
|
||||
|
||||
protected function echoRaw(bool $value) : self
|
||||
{
|
||||
$this->echoRaw = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class FormContext implements FormContextInterface
|
|||
$this->values = $request->getParsedBody() ?: [];
|
||||
|
||||
if ( ! $this->values ) {
|
||||
$content = utf8_encode((string) $request->getBody());
|
||||
$content = mb_convert_encoding((string) $request->getBody(), 'UTF-8');
|
||||
|
||||
if ( $content && ( $json = json_decode($content, true) ) ) {
|
||||
$this->values = $json;
|
||||
|
|
Loading…
Reference in New Issue