The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Bored with HTML

I suppose like many of you, I spend a whole lot of time marking up HTML; HTML which pollutes my PHP. I hate this mix of logic and presentation and I'm almost sick to death of typing tags. I've considered templating systems, but I don't want anything that has any logic of it's own- I'm a simple kinda guy.

I'm looking for a scheme that allows me to type a function name and provide arguments and it should return lovely HTML.

Am I barking mad, up the wrong tree, just lazy or missing the trick? Please somebody save me!

Gavin Laking Send private email
Friday, May 26, 2006
Missing the trick, actually hundreds of them. Everyone seems to have their own templating engine, but I think this article will give you a nice start:
Berislav Lopac Send private email
Friday, May 26, 2006

I found myself in exactly your situation.  Try out this templating engine:

You'll need to download the C version to get the manual, but the PHP version works with the same templates.  This is by design; I have some mixed systems with C and PHP.
Clay Dowling Send private email
Friday, May 26, 2006
I've been using phpHtmlLib. It works just as you've described. Call html_a(...), and you get an anchor element. It goes a step further in that the elements are objects, so you can add elements to elements. You can build up a page class, and then at the end call "print $page->render();"

I've been pretty happy with it. Very easy to set up. Just copy the files and add one include to your script.
Friday, May 26, 2006
Well, well, well! Another dissatisfied customer! Step right this way, my fellow [rubbing hands together greedily], and I will show you a product that will aboslutely, positively eliminate the requirement that you type another angle bracket ever again! It hums, it sings, it produces prodigious amounts of cr@p-for-HTML on your behalf.

But, it means you will have to leave your paradigm of PHP and come to the somewhat darker side of...


Where you will go barking mad for entirely other reasons that have nothing whatsoever to do with HTML.

Seriously though, HTML can be a pain. But, it sure beats digging ditches in the heat of summer (which I've done). I have never, ever been anything but grateful for any work that allows me to develop software. Even if it means marking up HTML.
Friday, May 26, 2006
Isn't this what ASP.NET and JSP have already built in? No wonder PSP is considered to be a mere toy if you have to go looking for third party components just to do simple templating.

Good luck!
Friday, May 26, 2006
Take a look at clearsilver ( - cleanly separate markup and PHP, and it has simple but adequate flow control and looping.  I've found it's a great way that for programmers (on the PHP side) and designers (on the markup side) to work in parallel.
A. Skeptic
Friday, May 26, 2006
Thanks everybody for your suggestions, I'll have a look into them all. Might starve off carpal tunnel a little longer!
Gavin Laking Send private email
Saturday, May 27, 2006
And I forgot to mention just then that I once spent a summer filling a ditch in with soil I had to barrow a couple hundred yards. And it wasn't for pay. I hated that too. :-P
Gavin Laking Send private email
Saturday, May 27, 2006
Depending on what you're doing, developing pages that adhere to W3C standards actually makes your markup much leaner and simpler in most cases.  Of course, then you'll have to find some PHP module that writes all your CSS for you... ;)
Brian Moeskau Send private email
Tuesday, May 30, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz