Template Engine like Smarty

G

global

Erich Pul ha escrito:
how do you combine C and HTML? IMHO if you want to use say OOP-like
functionality in HTML or alike, use PHP

greetings,

I know, i know, but i need it for C, i cannot change the language.
 
E

Erich Pul

I know, i know, but i need it for C, i cannot change the language.

well, HOW do you want to employ C with HTML? putout HTML code with C?
 
N

Neurotic

Erich Pul ha escrito:
well, HOW do you want to employ C with HTML? putout HTML code with C?

I want to modify a web server log file analysis program written in C
(the output it's a html). Now the code it's a mess and i want to use
html templates in order to make easier to modify the html output in the
future.
 
E

Erich Pul

I want to modify a web server log file analysis program written in C
(the output it's a html). Now the code it's a mess and i want to use
html templates in order to make easier to modify the html output in the
future.

ah, ok - thx for the fill-in... maybe it is possible to put the html
and include functions in C that add smarty-style functionality to it.
but AFAIK is smarty for PHP files, right? so if you are able to put out
..php files, you may have a cron or alike run over the files with a php
script and modify them? just a suggest though since i never actually
tried something like this...

hth,
 
N

Neurotic

Erich Pul ha escrito:
ah, ok - thx for the fill-in... maybe it is possible to put the html
and include functions in C that add smarty-style functionality to it.
but AFAIK is smarty for PHP files, right? so if you are able to put out
.php files, you may have a cron or alike run over the files with a php
script and modify them? just a suggest though since i never actually
tried something like this...

hth,

Thanks Erich but i don't want to complicate myself so much. Maybe a C
cgi library has some similar to Template Engine.
 
E

Erich Pul

Thanks Erich but i don't want to complicate myself so much. Maybe a C
cgi library has some similar to Template Engine.

maybe you can circumvent all the hassle by simply modifying the C code
to include a CSS-stylesheet into the output html. then you can simply
do the spacing etc. with relative or absolute DIVs and SPANs (just to
complicate this further ; )

greetings,
 
N

Neurotic

Erich Pul ha escrito:
maybe you can circumvent all the hassle by simply modifying the C code
to include a CSS-stylesheet into the output html. then you can simply
do the spacing etc. with relative or absolute DIVs and SPANs (just to
complicate this further ; )

greetings,

I'll do it using CSS but i want to have also the option of modify the
html easely. Thanks anyway :)
 
I

Ian Collins

Neurotic said:
Erich Pul ha escrito:




I want to modify a web server log file analysis program written in C
(the output it's a html). Now the code it's a mess and i want to use
html templates in order to make easier to modify the html output in the
future.
There isn't anything like PHP templates in C. PHP is an interpreted
language and the template fields are filled in at run time, with C you
have to form the document structure at compile time.

You should be able to break the problem down into its component parts
and come up with something like

outputHTML() which calls

outputHead() and outputBody() which calls

outputYourData().

You can break outputYourData() down into a set of functions that mimic
PHP templates.

If this is to be viewed via a browser, make it a CGI application and
place all your formatting in a CSS file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top