[fpc-pascal] Freepascal templating engines with logical structures
luciano de souza
luchyanus at gmail.com
Mon Sep 22 15:37:57 CEST 2014
Thank you. The options you had me done are very intersting.
I want to show HTML grids and I intend to use a templating engine for
this purpose. But, in stead of embed logics in the template, I think I
need to organize better my code.
Perhaps, I need to build a class THMLTable where I could set a dataset
to be shown and paginated. And by means of a text property, I can fill
the template with one of the presented engines.
2014-09-17 1:51 GMT-03:00, luciano de souza <luchyanus at gmail.com>:
> Hello all,
>
> I Know two templating engines for Freepascal: FPTemplate e JTemplate.
> Both can be successfully used for html construction.
>
> But they presents the same aspect: only searches and replaces tags to
> values.
>
> Of course, it's crucial. But to show html grids, obtained from
> database queries, it would be better if the templating engine had
> support for logical structures. Something like:
>
> <table>
> <%
> for row in rows do
> begin
> write('<tr>');
> for cell in cells do
> writeln('<td>%s</td>', [cell]);
> write('</tr>');
> end;
> %>
> </table>
>
> It's only an example. The engine can use a syntax different from Pascal.
>
> But what I really like is not to use Javascript. Yes, in the Pascal
> side, I could write a JSON and certainly, there would be several
> Javascript libraries to show a grid from a JSON. However, I would like
> a pure Pascal solution.
>
> Are there templating engines in Pascal with support for logical structures?
>
> Regards,
>
> --
> Luciano de Souza
>
--
Luciano de Souza
More information about the fpc-pascal
mailing list