2021-09-15 17:58:21 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Views\Components\Forms;
|
|
|
|
|
|
|
|
class Textarea extends FormComponent
|
|
|
|
{
|
|
|
|
public function setValue(?string $value): void
|
|
|
|
{
|
|
|
|
if ($value) {
|
|
|
|
$this->value = html_entity_decode($value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render(): string
|
|
|
|
{
|
|
|
|
unset($this->attributes['value']);
|
|
|
|
|
2021-11-01 18:12:03 +01:00
|
|
|
$this->attributes['class'] = 'w-full focus:border-black focus:ring-castopod rounded-lg border-3 border-black ' . $this->class;
|
2021-09-15 17:58:21 +02:00
|
|
|
|
|
|
|
$textarea = form_textarea(
|
|
|
|
$this->attributes,
|
|
|
|
old($this->name, $this->value ?? '', false)
|
|
|
|
);
|
|
|
|
|
|
|
|
return <<<HTML
|
|
|
|
{$textarea}
|
|
|
|
HTML;
|
|
|
|
}
|
|
|
|
}
|