Support recursive object traversal

Nested this.property traversal wasn't possible. With this fix, it is.
This commit is contained in:
David Deutsch 2013-04-02 13:12:27 +03:00
parent e6b4182a75
commit 0451fa2483

View File

@ -157,7 +157,9 @@ class Handlebars_Context
private function _findVariableInContext($variable, $inside, $strict = false)
{
$value = '';
if (is_array($variable)) {
if ( empty( $inside ) || ( $inside == 'this' ) ) {
return $variable;
} elseif (is_array($variable)) {
if (isset($variable[$inside])) {
$value = $variable[$inside];
}