Passing local variables to Erlydtl block
I've got a block of erlydtl code which I use repeatedly and would like to abstract to some kind of block / partial template. The issue is that I need to pass the block a local variable. This is possible with Rails partial templates; it looks like it's possible with Django's blocks [albeit with some kind of Python hackery]; I'm wondering if it's possible with Erlydtl [Erlang implementation of Django templates]
Ideas ?
Tha开发者_如何学Pythonnks you.
Maybe you could render the partial template with the variables you need to pass to it, and pass the result of that rendition into the full template.
I could be mistaken of what it is that you want, so please add some examples if I am.
精彩评论