3.7.0
Full Changelog: 3.6.8...3.7.0
Fixes
Fixed incorrect mixing of PHP 8.1 standards with PHP 8.0, which caused runtime errors.
New Features
PHP Layout Composition
Improved the PHP layout composition class and introduced new helper features.
The layout object is now automatically available inside PHP template files when App\Config\Template->enableDefaultTemplateLayout is enabled.
Dynamic Template Placeholders
Placeholders defined within a layout section are now resolved automatically when extending or rendering the layout with options:
<?php $this->layout->begin('title'); ?>
<h1>{{ placeholder }}</h1>
<?php $this->layout->end('title'); ?>Smarty Template Extension
Improved the Smarty extension to provide simpler access to functions and classes, giving it behavior in Luminova closer to Twig.
Object Method Access
You can now call object methods directly without assigning the object to a Smarty variable first:
{{ $self.app->doFoo()->getBar() }}Smarty & Twig Template Extension
Improved both extensions with a single configuration point for managing custom extensions and modifiers.
Template caching is now handled by Luminova for consistent behavior and integration with the static URL cache system.
Routing System
Optimized the routing system. All HTTP method helpers are now static.
Dependency Injection in routing has been improved to honor default parameter values when a dependency cannot be resolved.
Added the Router::isPrefix(...) helper for checking URI prefixes.
Static HTTP Helpers:
get— HTTP GETpost— HTTP POSTput— HTTP PUTpatch— HTTP PATCHdelete— HTTP DELETEhead— HTTP HEADoptions— HTTP OPTIONSany— Any valid HTTP methodmiddleware— Before-middleware handlerafter— After-middleware handlerguard— CLI middleware handlercapture— Custom HTTP methodscommand— CLI commandgroup— CLI command groupingbind— HTTP URI group bindingonError— HTTP error handler
HTTP Message Stream
Optimized the message stream class, added a new buffer method, and moved the class namespace from
Luminova\Utility\Storage\Stream to Luminova\Http\Message\Stream.
Global Import Function
The global import() function now supports promise resolving:
use function \Luminova\Funcs\import;
import('view:template', promise: true)
->then(fn(string $html) => print($html))
->catch(fn(Throwable $e) => echo $e->getMessage());