Merge pull request #11 from daviddeutsch/patch-1

Support recursive object traversal (this.property)
This commit is contained in:
Behrooz Shabani 2013-04-03 02:24:56 -07:00
commit 63cd738e64

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];
}