castopod/app/Views/Components/Forms/Textarea.php
Yassine Doghri a746a781b4 feat(themes): set generic css variables for colors to enable instance themes
- set new colors using the css variables for theming in tailwind.config.js
- replace admin and
public colors with new variable enabled colors
2021-12-29 12:06:10 +00:00

32 lines
704 B
PHP

<?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']);
$this->attributes['class'] = 'bg-elevated w-full focus:border-contrast focus:ring-accent rounded-lg border-3 border-contrast ' . $this->class;
$textarea = form_textarea(
$this->attributes,
old($this->name, $this->value ?? '', false)
);
return <<<HTML
{$textarea}
HTML;
}
}