- Base is done; most of the language's components are now working!

- Implemented OPCACHE caching
- Added View() token logic
- New FileFetcher added to gather files from given view path
This commit is contained in:
mcndave committed 2019-11-01 14:46:01 -04:00
1 parent bcd49884fc
commit 6701a1cd59
16 files changed
+323 -69

No files matched your search

+26 -9
View File
@@ -6,21 +6,36 @@ namespace %NAMESPACE%;
class %CLASSNAME% %EXTENDS% {
protected array $__section_list = [];
public array $sectionList = [];
protected array $__variables_list = [];
public array $variableList = [];
public final function __output() : void
public ?object $thisProxy = null;
public \Picea\Picea $picea;
public function __construct(\Picea\Picea $picea, array $variablesList = [], ?object $thisProxy = null) {
$this->picea = $picea;
$this->variableList = $variablesList;
$this->thisProxy = $thisProxy;
}
public function output(array $variablesList = []) : void
{
extract($this->__variables_list); ?>%CONTENT%<?php
( function($___class__template, $___global_variables, $___variables) {
extract($___global_variables);
extract($___variables, \EXTR_OVERWRITE);
?>%CONTENT%<?php
} )->call($this->thisProxy ?? new class(){}, $this, $this->variableList, $variablesList);
%PARENT_OUTPUT%
}
public final function __renderSection($name) : void
public function renderSection($name) : void
{
foreach([ 'prepend', 'default', 'append' ] as $item) {
usort($this->__section_list[$name][$item], fn($a, $b) => $a['order'] <=> $b['order']);
usort($this->sectionList[$name][$item], fn($a, $b) => $a['order'] <=> $b['order']);
foreach($this->__section_list[$name][$item] as $section) {
foreach($this->sectionList[$name][$item] as $section) {
$section['callback']();
if ( $item === 'default' ) {
@@ -30,9 +45,11 @@ class %CLASSNAME% %EXTENDS% {
}
}
public final function __invoke() {
public function __invoke(array $variablesList = []) {
ob_start();
$this->__output();
$this->output($variablesList);
return ob_get_clean();
}
}
return [ 'classname' => "%CLASSNAME%", 'namespace' => "%NAMESPACE%", 'extends' => "%EXTENDS_TEMPLATE%" ];