- Work on Language Handler and extension.
- Added an URL extension which allows routes and URLs. - Fixed some bug within ClassTemplate
This commit is contained in:
1 parent
a64989af9f
commit
ddc3ae704a
10 files changed
+267
-82
No files matched your search
@@ -8,29 +8,34 @@ class %CLASSNAME% %EXTENDS% {
|
||||
|
||||
public array $sectionList = [];
|
||||
|
||||
public array $variableList = [];
|
||||
public array $variableList = [];
|
||||
|
||||
public ?object $thisProxy = null;
|
||||
|
||||
public \Picea\Picea $picea;
|
||||
|
||||
public static $context;
|
||||
|
||||
public function __construct(\Picea\Picea $picea, array $variablesList = [], ?object $thisProxy = null) {
|
||||
$this->picea = $picea;
|
||||
$this->variableList = $variablesList;
|
||||
$this->thisProxy = $thisProxy;
|
||||
$this->exportFunctions();
|
||||
|
||||
static::$context = $picea->context;
|
||||
}
|
||||
|
||||
public function output(array $variablesList = []) : void
|
||||
{
|
||||
( function($___class__template, $___global_variables, $___variables, $___picea) {
|
||||
extract($___global_variables); unset($___global_variables);
|
||||
extract($___variables, \EXTR_OVERWRITE); unset($___variables);
|
||||
public function output(array $variablesList = []) : void
|
||||
{
|
||||
( function($___class__template, $___global_variables, $___variables, $picea) {
|
||||
extract($___global_variables);
|
||||
extract($___variables, \EXTR_OVERWRITE);
|
||||
?>%CONTENT%<?php
|
||||
} )->call($this->thisProxy ?? new class(){}, $this, $this->variableList, $variablesList, $this->picea);
|
||||
%PARENT_OUTPUT%
|
||||
}
|
||||
}
|
||||
|
||||
public function renderSection($name) : void
|
||||
public function renderSection($name) : void
|
||||
{
|
||||
foreach([ 'prepend', 'default', 'append' ] as $item) {
|
||||
usort($this->sectionList[$name][$item], fn($a, $b) => $a['order'] <=> $b['order']);
|
||||
@@ -44,8 +49,15 @@ class %CLASSNAME% %EXTENDS% {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function exportFunctions() : void
|
||||
{
|
||||
static $caching = [];
|
||||
%FUNCTIONS%
|
||||
}
|
||||
|
||||
public function __invoke(array $variablesList = []) {
|
||||
public function __invoke(array $variablesList = []) : string
|
||||
{
|
||||
ob_start();
|
||||
$this->output($variablesList);
|
||||
return ob_get_clean();
|
||||
|
||||
Reference in new issue
Block a user