mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Update Context::get to resolve @key and @index
This commit is contained in:
parent
0f65f12db3
commit
1119784549
@ -219,6 +219,10 @@ class Context
|
||||
return '';
|
||||
} elseif ($variableName == '.' || $variableName == 'this') {
|
||||
return $current;
|
||||
} elseif ($variableName == '@index') {
|
||||
$current = $this->lastIndex();
|
||||
} elseif ($variableName == '@key') {
|
||||
$current = $this->lastKey();
|
||||
} else {
|
||||
$chunks = explode('.', $variableName);
|
||||
foreach ($chunks as $chunk) {
|
||||
|
Loading…
Reference in New Issue
Block a user