jarednova/timber — pull request #92 by asecondwill (2013-10-24 00:34:11+00:00)
Title: Update TimberComment.php to have an avatar method

Is this helpful? I like how there are a bunch of easy ways i could do this.

alternatives:

i could just swap out the class in my themes twig functions & then in single.twig do:
{% for cmt in post.get_comments(0, 'wp', 'comment', 'approve', 'KindlingComment') %}

class KindlingComment extends TimberComment {
function avatar($size='32', $default=''){
// Fetches the Gravatar
// use it like this
// {{comment.avatar(36,template_uri~"/img/dude.jpg")}}
return get_avatar($this,$size,$default );
}
}

or make a function in my theme twig. yeah probably this one.
$function = new Twig_SimpleFunction('avatar', function ($comment, $size = 32, $default = '') {
return get_avatar($comment, $size, $default);
});
$twig->addFunction($function);