- 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

+6 -6
View File
@@ -13,8 +13,8 @@ class SectionToken implements ControlStructure {
$options = eval($options);
}
if ( ! ctype_alnum(str_replace([".", "\"", "'"], "", $name)) ) {
throw new \RuntimeException("Your section named `{$name}` contains invalid character. Allowed are only letters, numbers and dots");
if ( ! ctype_alnum(str_replace([".", "\"", "'", "-", "_"], "", $name)) ) {
throw new \RuntimeException("Your section named `{$name}` contains invalid character. Allowed are only letters, numbers, dashes, underscores and dots");
}
$context->sections[] = [
@@ -28,10 +28,10 @@ class SectionToken implements ControlStructure {
throw new \RuntimeException("An unsupported action `$action` was given as an option of a {% section %} tag");
}
$order = $options['order'] ?? "count(\$this->__section_list[$name]['$action'])";
$order = $options['order'] ?? "count(\$___class__template->sectionList[$name]['$action'])";
return "<?php \$this->__section_list[$name] ??= [ 'prepend' => [], 'append' => [], 'default' => [] ];
\$this->__section_list[$name]['$action'][] = [ 'order' => $order, 'callback' => function() {
extract(\$this->__variables_list); ?>";
return "<?php \$___class__template->sectionList[$name] ??= [ 'prepend' => [], 'append' => [], 'default' => [] ];
\$___class__template->sectionList[$name]['$action'][] = [ 'order' => $order, 'callback' => function() use (\$___class__template, \$___global_variables, \$___variables) {
extract(\$___global_variables); extract(\$___variables, \EXTR_OVERWRITE); ?>";
}
}