mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 02:26:41 +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 '';
|
return '';
|
||||||
} elseif ($variableName == '.' || $variableName == 'this') {
|
} elseif ($variableName == '.' || $variableName == 'this') {
|
||||||
return $current;
|
return $current;
|
||||||
|
} elseif ($variableName == '@index') {
|
||||||
|
$current = $this->lastIndex();
|
||||||
|
} elseif ($variableName == '@key') {
|
||||||
|
$current = $this->lastKey();
|
||||||
} else {
|
} else {
|
||||||
$chunks = explode('.', $variableName);
|
$chunks = explode('.', $variableName);
|
||||||
foreach ($chunks as $chunk) {
|
foreach ($chunks as $chunk) {
|
||||||
|
Loading…
Reference in New Issue
Block a user