473,508 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Template Engine like Smarty

There is a Template Engine for C like Smarty (http://smarty.php.net/)
to separate the html from the C code?

Thanks,
Carlos.

Jun 22 '06 #1
10 3854
gl****@neuroticweb.com wrote:
There is a Template Engine for C like Smarty (http://smarty.php.net/)
to separate the html from the C code?


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

greetings,
--
EP

Jun 22 '06 #2

Erich Pul ha escrito:
gl****@neuroticweb.com wrote:
There is a Template Engine for C like Smarty (http://smarty.php.net/)
to separate the html from the C code?


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

greetings,
--
EP


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

Jun 22 '06 #3
> 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?

Jun 22 '06 #4

Erich Pul ha escrito:
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?


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.

Jun 22 '06 #5
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,
--
erich pul

Jun 22 '06 #6

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.


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,
--
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.

Jun 22 '06 #7

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,
--
E

Jun 22 '06 #8

Erich Pul ha escrito:
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,
--
E


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

Jun 22 '06 #9
Neurotic wrote:
Erich Pul ha escrito:

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?

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.

--
Ian Collins.
Jun 22 '06 #10

gl****@neuroticweb.com ha escrito:
There is a Template Engine for C like Smarty (http://smarty.php.net/)
to separate the html from the C code?

Thanks,
Carlos.

I found this (well, actually i asked in www.barrapunto.com):
http://www.clearsilver.net
http://goog-ctemplate.sourceforge.net/ (only for C++)

But i think i'll modify the program to output a xml file (using xslt
templates after)

Thanks to all :)

Jun 23 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2153
by: beale | last post by:
Hi, I have been doing some reading on the template systems available for use with php to separate design from coding. I have been looking at the FastTemplate and Smarty solutions. From the...
4
15460
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
16
2338
by: Andrea A | last post by:
Hi, i'm developing a website that will have an huge amount of visitors a day --> it will be a contest with 100.000$ of prize. I'm concerning about using a template class (and which one do you...
6
2196
by: Don Sutter | last post by:
Hello, I'm looking for "Template" recomendations for PHP 4, like which one is popular or has the best/most features. I'm somewhat of a newbie with PHP and bacame interested in templates via...
2
2499
by: Brian | last post by:
I have an application that uses an array of values as a "lookup" table and smarty as a template engine. $lookup = "label"; $lookup = "label2"; $lookup = "label"; $lookup = "label2"; In my...
1
1606
by: Wensheng | last post by:
Hi, I wrote a small template engine called spytee. Like any template enigne, it take a text(html) template file as input, process the variable tags in the file, and display the resulted text. The...
8
2513
by: HchC | last post by:
PHP is already a HTML templating laguage, but I am looking for a HTML template engine for users who know nothing about HTML. This template engine should not be too complex, as this is for very...
0
1592
by: Conrad | last post by:
Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on the Windows XP Professional platform and I have the following question: When I change the 7th line of the script to use a...
14
1551
by: Egbert Teeselink | last post by:
Hi all, The last few months I've worked on making a template engine because the ones out there didn't serve my needs. I guess everybody knows Smarty and has an opinion on it; I like many things...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.