sstephenson / eco

Embedded CoffeeScript templates
MIT License
1.71k stars 70 forks source link

Pre and Post functions for templates #34

Closed KyleAMathews closed 12 years ago

KyleAMathews commented 12 years ago

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.

KyleAMathews commented 12 years ago

Closing this. I'm accomplishing what I want using Backbone.js Views.