开发者

Passing local variables to Erlydtl block

开发者 https://www.devze.com 2022-12-24 06:12 出处:网络
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 possi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消