sstephenson/eco — Issue #34: Pre and Post functions for templates
Author: KyleAMathews
Created: 2011-11-30 17:45:14+00:00
State: open

I have a situation for a web app I'm building where it'd be really convenient to be able to create pre and post functions for some of the templates I've created. One example of what I'd like to do is to check rendered HTML for overly long links that need shortened. Right now I'm putting this sort of code after each place in the app the template is called but it'd be much more DRY to have pre/post functions.

Is there a way already of doing this that I haven't thought of? Or if not, if someone could give me a few pointers, I'd be happy to write a patch to add this functionality.