v0.9.6
This commit is contained in:
commit
1396974b03
286 files changed
+19411
No files matched your search
@@ -0,0 +1,14 @@
|
||||
@props(['page' => null, 'blocks' => null])
|
||||
{{--
|
||||
The blocks of a page, drawn with the views of the types. `<x-manager::blocks page="home" />` reads the page; `:blocks="$blocks"` takes
|
||||
what `Blocks::for()` gave. A view of the site (resources/views/blocks/<type>.blade.php) wins over the package's, a type without a view draws nothing.
|
||||
--}}
|
||||
@php
|
||||
$list = $blocks ?? ($page !== null ? \IriksIT\Manager\Support\Blocks::for((string) $page) : []);
|
||||
@endphp
|
||||
@foreach ($list as $block)
|
||||
@php($view = \IriksIT\Manager\Support\Blocks::view((string) $block['type']))
|
||||
@if ($view !== null)
|
||||
@include($view, ['block' => $block, 'data' => $block['data'], 'style' => $block['style'], 'items' => $block['items'] ?? [], 'classes' => \IriksIT\Manager\Support\Blocks::classes($block['style'])])
|
||||
@endif
|
||||
@endforeach
|
||||
Reference in new issue
Block a user