twitter/hogan.js — pull request #97 by mcheely (2012-07-18 00:22:07+00:00)
Title: Support lookup of model values via object.get(key)

We've been using hogan with backbone, and I've been thinking for a while now that it would be nice if hogan could find model properties using model.get('foo'), rather than requiring templates to sometimes dig into model.attributes & sometimes calling model.isFoo for methods.

This patch causes templates to fall back to looking up keys in objects with get() if the key can't be found directly. Other options & approaches I considered were:

* Enable this behavior via an option passed to Hogan.compile (similar to disableLambda)
* Allow setting a custom name resolution method option in Hogan.compile. (Here's a gun aimed at your foot, have fun!) i.e:

```javascript
Hogan.compile(template, {
resolveName: function(name, object) {
return object[name]; //this would not work, but you get the idea
}
});
```