Skip to content

3.7.0

Choose a tag to compare

@peterujah peterujah released this 12 Dec 12:48
· 1 commit to main since this release

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 GET
  • post — HTTP POST
  • put — HTTP PUT
  • patch — HTTP PATCH
  • delete — HTTP DELETE
  • head — HTTP HEAD
  • options — HTTP OPTIONS
  • any — Any valid HTTP method
  • middleware — Before-middleware handler
  • after — After-middleware handler
  • guard — CLI middleware handler
  • capture — Custom HTTP methods
  • command — CLI command
  • group — CLI command grouping
  • bind — HTTP URI group binding
  • onError — 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());