Pool: Php/Html organization

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply

Which Php/Html organization do you mostly use for displaying pages of your Web Applications?

Html body with embeded Php parts
1
8%
Pure Php, sometime inserting or coding Html parts
5
42%
Template Engine
6
50%
Other (comments welcome)
0
No votes
no Html or Xhtml (comments welcome)
0
No votes
 
Total votes: 12

User avatar
Skrol29
Forum Newbie
Posts: 4
Joined: Wed Jun 30, 2004 5:55 pm

Pool: Php/Html organization

Post 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.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post 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.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post 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.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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).
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post 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.
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

I always use templates and am a big fan of ETS and Smarty.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
Post Reply