Forked from https://gist.github.com/1532562 In the “Better than templates” article Neil Jenkins expose some methods and use case of this function.