On Sun, 21 Oct 2012 07:57:17 GMT, Sönke Ludwig wrote:
On Sun, 21 Oct 2012 02:21:13 GMT, denizzzka wrote:
Compiling diet template 'test.dt'...
test.dt(7): Error: undefined identifier PGtext, did you mean template text(T...)?
test.dt(7): Error: cannot resolve type for (*answ.opIndex(0LU,0LU)).as!(error)
test.dt(7): Error: template vibe.templ.diet.toString does not match any function template declaration<br>diet.d(912): Error: template vibe.templ.diet.toString(T) cannot deduce template function from argument types !()(error)
(answ[0,0].as!PGtext is actually a string type)
Apparently, I do not understand what types of variables supports templates parser. It would be convenient to show result of sql query in the template, but at the moment I can't.
For most external symbols, you need to add an appropriate import statement, as the compiled template file has it's own scope:
- import module.containing.pgtext;
Where? At the point where renderer called "import" already added (and assignment to a variable "cell" works well)
Btw. (I know I need to change the documentation at some places)
render!()is still suspicious for linker errors, or worse, memory corruption, because the corresponding DMD issue was never fully resolved (although marked as such). I still need to do a dustmite run at some day. But for now
renderCompat!()is the safer choice.