[Gambas-user] Gambas WebPage

Benoît Minisini gambas at ...1...
Sat Jan 28 11:06:00 CET 2012


Hi all,

I have started the support of a new kind of "form" in the IDE, the 
"WebPage".

WebPage is an HTML page with ASP-like syntax. It is implemented in the 
gb.web component.

The IDE now can edit WebPage, but cannot compile them.

Actually it is "just" a matter of modyfing the compiler so that the 
WebPage is transformed into Gambas code that generates the final HTML.

At the moment, the following ASP-like syntax will be implemented:

- <% ... %> to insert any Gambas code.

- <%= ... %> to insert the result of a Gambas expression. Html$() will 
be automatically called.

- Maybe something like <%INCLUDE ... %> to include a WebPage in another one.

Note that the WebPage is a file with a ".webpage" extension, and that, 
they have their own class file attached (like any form).

That way, you don't have to put all your code inside the HTML. Just what 
is needed.

Internally all WebPages will inherit the WebPage class, and will have a 
"Render" method to render their contents (i.e. print to the standard 
output - don't forget that a Gambas web application is a CGI script!). 
They can be startup class too.

I'd like to have the thoughts of Gambas users about that: what kind of 
syntax you would like, what ideas you have...

One idea I have would be a standard syntax for the URL received by the 
CGI script, so that the displayed WebPage would be automatically 
selected from it. It could be something as simple as 
"http://myapp.com/<form name>".

Thanks in advance for your comments.

Regards,

-- 
Benoît Minisini




More information about the User mailing list