lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi André,

Andre Carregal wrote:

You lost me here, could you please send some example of your intended
generation? Something like the examples presented below could help me
understanding your sequence needs.

My intended configuration would be like the scenario number 3 you've described:

3) Lua Pages with calls to a library: URL -> page.lp <-> lib.lua -> results
A simple way to separate business and presentation logic

The Lua page runs the library at the very beginning. Sometimes the library would decide to make a redirect, which is impossible with the current CGILua.

4) Lua Scripts with calls to a library that uses Lua Pages as subtemplates:
URL -> page.lua <-> lib.lua <-> template.lp -> results
That would be the basics for a MVC implementation (aka "model 2"), allowing
further separation of presentation and business logic.

MVC is always a good thing to aim for. But the current Lua pages are more code-like than template-like. Take Smarty ( for instance. If I want to output a table with the name and telephone of a bunch of people I don't have to write a loop in my PHP page if I am using Smarty, there is a tag that iterates over associative arrays. Nevertheless this scenario seems to be the best with current CGILua. I think I will change my code and give it a try.