hogan.js style template inheritance

This commit is contained in:
Dan Miller
2014-04-04 18:41:24 +00:00
parent 6fa8518a9a
commit db14a6c863
8 changed files with 614 additions and 8 deletions
+12
View File
@@ -120,6 +120,18 @@ class Mustache_Context
return $value;
}
public function findFromParent($id)
{
$stack = $this->stack;
foreach($stack as $context) {
if (is_array($context) && array_key_exists($id, $context)) {
return $context[$id];
}
}
return '';
}
/**
* Helper function to find a variable in the Context stack.
*