mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Implement template v2 feature of pushing to stack
This commit is contained in:
parent
7b518ab747
commit
c19d71847f
5 changed files with 95 additions and 8 deletions
|
|
@ -30,6 +30,7 @@ class Template
|
|||
public $vars;
|
||||
protected $_fragments = [];
|
||||
protected static $_loopvars = [];
|
||||
protected static $_stacks = [];
|
||||
|
||||
/**
|
||||
* Static properties
|
||||
|
|
@ -411,6 +412,24 @@ class Template
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the contents of a stack.
|
||||
*
|
||||
* @param string $name
|
||||
* @return ?array
|
||||
*/
|
||||
public function getStack(string $name): ?array
|
||||
{
|
||||
if (isset(self::$_stacks[$name]))
|
||||
{
|
||||
return self::$_stacks[$name];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a path should be treated as relative to the path of the current template.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue