[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [CGILua 5.0b2] Possible bug and change request
- From: Tomas <tomas@...>
- Date: Mon, 10 Jan 2005 21:55:57 -0200 (BRDT)
Hi Alex,
On Mon, 10 Jan 2005, Alex Sandro Queiroz e Silva wrote:
> I've written a Lua module with functions that are to be called from
> a Lua page.
Why don't you write a Lua script with the core module?
This script could execute another Lua script (as you already done)
and could also execute Lua pages, by calling cgilua.preprocess or
cgilua.includehtml (if the header must be different than text/html).
> The first thing the Lua page does is 'cgilua.doscript
> "./lib/colablib.lua"' (I couldn't get require to import a module not in
> the standard path) and then comes some static content.
This restriction on `require' is deliberate, to avoid
loading libraries (mainly binary ones) not installed in the system.
As you said, "then comes some static content", this static
content is to be shown. If you you want this content to be optional,
it should lay in another file (or in a function), loaded (or called)
if the script decides to do so.
I think PHP is not like that, but I am not sure. This
is our way of doing things :-) I don't know if I am been clear;
I can send you an example if you prefer.
Tomas