- First commit of first draft

This commit is contained in:
mcndave committed 2019-08-21 16:11:39 -04:00
commit 66c7b349d1
36 files changed
+820

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
<?php
namespace %NAMESPACE%;
%USE%
class %CLASSNAME% %EXTENDS% {
protected array $__section_list = [];
protected array $__variables_list = [];
public function output() : void
{
extract($this->__variables_list); ?>%CONTENT%<?php
}
public function __renderSection($name) : void
{
foreach([ 'prepend', 'default', 'append' ] as $item) {
usort($this->__section_list[$name][$item], fn($a, $b) => $a['order'] <=> $b['order']);
foreach($this->__section_list[$name][$item] as $section) {
$section['callback']();
if ( $item === 'default' ) {
break 1;
}
}
}
}
public function __renderTemplate() {
ob_start();
$this->output();
return ob_get_clean();
}
}