On Thu, 31 May 2012 19:27:07 +0200, Richard Kubina rjkubina@gmail.com
wrote:
Hi, total noober here.
in my app.d i have added this function:
int hello(){
return 3;
}
//end
..how can i call this function in my index.dt? I tried:block body
h1 Example page - Home p hey #{hello()}
did i miss the example in your documentation on the website? i got some
simple addition to work, but i can't call a function.thank you
If I'm not mistaken (noob here too), #{variable} is variables you pass to
the template from your code, or variables you create in the diet template.
You can call functions be prepending an -
block body
-auto msg = hello();
p #{msg}
it might also work with
-auto msg = hello();
p= msg
Or even (but I dont think so):
p= hello();
You might need to import your file first, but that is as easy as:
- import yourmodule;