Releases: Stillat/blade-parser
Releases · Stillat/blade-parser
2.0.0
1.10.3
- Improves parsing of component attribute echo values
1.10.2
- Adds license to
composer.json- thanks @vintagesucks !
1.10.1
- Restores support for PHP 8.1
1.10.0
This release adds a few new helper methods:
toDocument()onDocumentParsersimplifies the process of converting an existingDocumentParserto aDocumentinstancetoDocumentwill resolve structures on the document by default. To prevent this, simply supplyfalsewhen calling (i.e.,toDocument(false))
parseTemplateonDocumentParserparses the input like the existingparsemethod, but will return theDocumentParserinstance instead of a node array
New AttributeCompiler
The AttributeCompiler is a new compiler service that can be used to compile attributes/parameters on a parsed ComponentNode. The AttributeCompiler implementation will use the core Laravel compiler for content that contains interpolated values.
Usage:
<?php
use Stillat\BladeParser\Parser\DocumentParser;
use Stillat\BladeParser\Compiler\CompilerServices\AttributeCompiler;
$template = <<<'TEMPLATE'
<prefix:component
parameter="content"
:binding="$theVariable"
/>
TEMPLATE;
$params = (new DocumentParser)
->onlyParseComponents()
->registerCustomComponentTags(['prefix'])
->parseTemplate($template)
->toDocument()
->getComponents()
->first()
->parameters;
$compiler = new AttributeCompiler;
$result = $compiler->compile($params);After compilation, $result would contain the following:
['parameter'=>'content','binding'=>$theVariable]
1.9.0
- Bumps the minimum PHP version to 8.2
- Migrates the test suite to Pest
- Code cleanup/formatting 🧹
- Improves parsing of HTML fragments and attributes/parameters
1.8.0
- Adds new helper methods to determine the type of an
EchoNodeEchoNode::isRaw(),EchoNode::isTriple(), andEchoNode::isRegular()
1.7.2
1.7.1
1.7.0
- Updates dependencies to allow Laravel 11
- Refactors some tests