castopod/app/Views/Components/Forms/Textarea.php
Yassine Doghri 4a8147bfbb feat: add podcast banner field for each podcast + refactor images configuration
- rename image fields on podcast, episode and persons for better clarity
- set different sizes
config for podcast cover, banner and persons avatars
- add tiny size for covers
- fix responsive
on admin forms
2021-12-29 12:04:04 +00:00

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