tiagosimoes
1 month ago
171
5
Laravel

Render anonymous component from a string

Posted 1 month ago by tiagosimoes

Hi ,

is there some way to render a anonymous component from a string , for example :

$html = "

< x-ui.avatar name="John Doe">

lorem ipsum ....

";

When I try to render the html with the component it shows the <x-ui.avatar> tag but it doesn't render.

view('components.ui.avatar') renders but since I have props inside the component it gives me error in getting the attributes.

Thanks.

PS:Added space in < x.ui.avatar> on purpose for showing here

Please sign in or create an account to participate in this conversation.