Skip to content

1.4.0

Choose a tag to compare

@JohnathonKoster JohnathonKoster released this 13 May 19:16
· 60 commits to master since this release
bac16bf

This release adds support for compiling name attributes on named slots:

<x-input-with-slot>
    <x-slot  class="text-input-lg" name="the_slot_name" data-test="data">Test</x-slot>
</x-input-with-slot>

Additionally, we can now easily fetch either a ParameterNode or the slot's string name via. some new utility methods:

<?php

use Stillat\BladeParser\Document\Document;

$template = <<<'BLADE'
<x-input-with-slot>
    <x-slot class="text-input-lg" name="the_slot_name" data-test="data">Test</x-slot:input>
</x-input-with-slot>
BLADE;

$doc = Document::fromText($template);

$slot = $doc->findComponentByTagName('slot');

// getName() will return a ParameterNode
// in this scenario, allowing us to
// get additional information.
$slot->getName()->value;