-
Notifications
You must be signed in to change notification settings - Fork 418
Open
Description
Componetization syntax
Current:
<div>
<?php View::render('myComponent', [
'attr' => 'value'
] ?>
</div>Requested🙌🏽🔥
<div>
<f-MyComponent attr="value" />
</div>fprefix can be customizable- components folder must be defined first or
/views/componentsis taken by default and map functions or classes
function MyComponent(array $props): string {
return <<<html
<div>{$props['attr']}</div>
html;
}
// or
class MyComponentClass {
function __construct(array $props) {
// initialize properties, call preparation methods or whatever
}
function render(): string {
// return html code
}
}Metadata
Metadata
Assignees
Labels
No labels