Page 1 of 1
Pool: Php/Html organization
Posted: Tue Nov 09, 2004 5:06 am
by Skrol29
Hello,
I'm a developper of a Template Engine and I'm unable to mix Php and Html in a same script. So I wonder which technics are used to code Web Applications.
All comments welcome about Php/Html organization.
Posted: Tue Nov 09, 2004 9:34 am
by CoderGoblin
Simplistic file structure
Code: Select all
<?php
// Process input
// change whatever and build a 'body' variable
// call outputFunction(javascript_file,css_file,title,body) (tends to be in an include)
?>
That's it.
Posted: Tue Nov 09, 2004 12:21 pm
by andre_c
It depends,
if it's a website I use Smarty.
If it's a web application I use my own WidgetSet class.
Posted: Tue Nov 09, 2004 2:08 pm
by McGruff
If I could vote it would be for option 1 AND 3. I like the
WACT idea of compiling templates. Knocks the socks off Smarty.
Posted: Tue Nov 09, 2004 2:48 pm
by Weirdan
McGruff wrote:If I could vote it would be for option 1 AND 3. I like the
WACT idea of compiling templates. Knocks the socks off Smarty.
Does that really differs from Smarty compiled templates?
Sorry for not following my own habit to RTFM prior to asking any questions, unfortunately I have no time at the moment to dig through their wiki (what an awful idea to store documentation in a wiki).
Posted: Tue Nov 09, 2004 3:55 pm
by McGruff
I knew Smarty supported page caching but I didn't realise it could also compile to avoid run-time template parsing. I should take another look at it.
Some WACT benchmarks
here.
PS: yeah the Wiki isn't a perfect format. Lots of good design theory in there though if you can track it down.
Posted: Tue Nov 09, 2004 4:17 pm
by Sevengraff
I always use templates and am a big fan of
ETS and Smarty.
Posted: Tue Nov 09, 2004 4:37 pm
by timvw
imho XSL(T) is more portable than template engines that depend on PHP.
i prefer to use PHP as template engine, but the php that is embedded in the html should only perform output stuff....
the flow control and data accessing should happen in separate files/classes/functions... outside the html