Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate dynamic html

to export some data i want to be able to generate an html output.

I have some constant content to output, like html headers and footers.

My question is how to deal with that ? Do I have to embed some template (in a resource file) and parse it to make it dynamic ? Do I store my static content in some constant (is there a 255 char limit?) and append them while generating the dynamic content ?

Do you have some hints, useful links, or best practices to share?

Thanks

like image 427
Fred Avatar asked Dec 17 '22 01:12

Fred


2 Answers

Use the Delphi TPageProducer. It generates HTML from a 'close to HTML' template which contains special tage. You respond to these tag in an event and replace them with your own data. Works a treat.

like image 123
Brian Frost Avatar answered Dec 19 '22 16:12

Brian Frost


I've created a Delphi project that handles this issue also. I wanted to create a web-platform that uses Delphi-code in the same source-files as the HTML, much like other web-scripting platforms, but still compiles a library to run. (and auto-compiles on changes)

http://xxm.sf.net/

In its basic form it compiles into library that can be run by a handler for IIS (ISAPI extension), InternetExplorer (IInternetProtocol as its own URL scheme), or a stand-alone HTTP process. (Apache module and FireFix plug-in are on the way).

like image 20
Stijn Sanders Avatar answered Dec 19 '22 14:12

Stijn Sanders