Closed iskrisis closed 3 years ago
@iskrisis I have no idea for now, i'll take care 👍
@iskrisis Do you mean old usage like @component('alert')
or new usage like <x-alert />
?
Mostly <x-alert />
but i would think both ways would work if component was registered. I am not sure where to do it or if it is even possible.
I tried to implement the new usage/register(component library) but I got some errors for now. But you can use the old method in current version as @component('alert')
Feel free create PR if you have a solution for new component usage 👍
Thanks for the info! I wasn't even aware i can use @component('alert')
/site/templates/default.blade.php
@component('components.alert')
<strong>Whoops!</strong> Something went wrong!
@endcomponent
/site/templates/components/alert.blade.php
<div class="alert alert-danger">
{{ $slot }}
</div>
I'll just leave this here - https://github.com/jenssegers/blade/issues/49 - and maybe will look into it later.
I've been working with laravel lately and i really like the
@iskrisis Have you look out?
@afbora amazing thanks!
@iskrisis I've used beebmx/kirby-blade and it works well enough - there was just a couple of issues between the blade and the content representations, if you use those. Otherwise, it works well.
👍
PSA: I was having trouble using components the way @afbora described. Using his example, all tags would be escaped/written out. I had to change {{ $slot }}
to <?= $slot ?>
. Why this is working, I have no idea 🤣 But maybe it helps someone else.
Is it possible to register/use components? Like here https://laravel.com/docs/7.x/blade#components ?