castopod/app/View/Components/Forms/XMLEditor.php
Yassine Doghri 94872f2338 feat(ui): create ViewComponents library to enable building class and view files components
- 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
2021-12-29 11:54:22 +00:00

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;
}
}