mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-05 08:52:00 +00:00

- replace some helper components and forms with class components in the ui - create viewcomponents service and load the component function to be used in views
31 lines
573 B
PHP
31 lines
573 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\View\Components\Forms;
|
|
|
|
use ViewComponents\Component;
|
|
|
|
class XMLEditor extends Component
|
|
{
|
|
protected string $content = '';
|
|
|
|
/**
|
|
* @var array<string, string>
|
|
*/
|
|
protected array $attributes = [
|
|
'slot' => 'textarea',
|
|
'rows' => '5',
|
|
'class' => 'textarea',
|
|
];
|
|
|
|
public function render(): string
|
|
{
|
|
$textarea = form_textarea($this->attributes, $this->content);
|
|
|
|
return <<<CODE_SAMPLE
|
|
<xml-editor>{$textarea}</time-ago>
|
|
CODE_SAMPLE;
|
|
}
|
|
}
|