#1 2019-05-22 17:50:53

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

[solved] Dmustache - can I call partial recursively?

With the Dmustache template engine, can  I call a partial recursively?
The case is generating multi-level sub-menus, where the levels of the menus are dynamic.

From this stackoverflow question (https://stackoverflow.com/a/31927431/133516), the official JS mustache does support recursive calling of partials.

Thanks.

Last edited by edwinsn (2019-05-23 05:46:23)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2019-05-23 05:46:07

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: [solved] Dmustache - can I call partial recursively?

Found the answer from the document: "Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Justavoid infinite loops. ".

So the answer is YES.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB