[fpc-pascal] fpweb tutorial

Michael Van Canneyt michael at freepascal.org
Tue Jul 13 17:10:02 CEST 2010



On Tue, 13 Jul 2010, Felipe Monteiro de Carvalho wrote:

> Hello,
>
> Thanks, with this blog I seam to be going somewhere and it worked ok
> with fpc 2.4.0 and the weblaz.lpk package.
>
> One thing still: Is there support for templates?
>
> I am doing something like this to load my page:
>
> procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: TRequest;
>  AResponse: TResponse; var Handled: Boolean);
> begin
>  AResponse.ContentType := 'text/html;charset=utf-8';
>  AResponse.Contents.LoadFromFile(ExtractFilePath(ParamStr(0)) +
> 'mainpage.html');
>  Handled := True;
> end;
>
> Something like powutils templates would be extremely handy ... all
> that html mixed with pascal doesn't look very nice.

You have templates, if you use actions.

Just create an action, and assign a template to it.

Michael.



More information about the fpc-pascal mailing list