HAML instead of HTML


has anybody played with this HAML yet?


It looks pretty interesting, and I know that most of the Rails guys are using it.

Unfortunately, the PHP version hasn’t been updated since mid 2007!? Is there something else out there that I’m not aware of? (don’t say smarty, please ;) )


You’ve probably never heard of my template engine…


Might be worth checking out - I have been using Yii for about a month now, and I plan to integrate my template engine as soon as I can find the time.

Highlights: tiny footprint, super fast, has all the common templating features (compiled templates, modifiers, multi-level caching, blocks, dynamic inserts, etc.), and it’s easy to learn - it borrows from PHP syntax, but makes it much shorter, making for templates that are more legible than plain PHP.

I am also hoping to add Yii-specific plugins to wrap CHtml, making form construction shorter and more legible.

My engine has been around for a some years, so it’s reasonably mature, and has been used in production on some large sites, but never gained much traction in terms of users. I’m not exactly sure why, but I suspect a lot of people glance it and, because they’ve seen the enormous codebases powering the mainstream template engines, they assume that it can’t possibly do much. In actuality, it does pretty much everything the major engines do.

Or rather, it doesn’t have to - it just leverages existing PHP functionality to do most of the work. The truth is that PHP itself is an excellent template engine, and already has most of the features that template engines re-implement on top of it - it just doesn’t have the most practical/prettiest/shortest syntax when it comes to view (HTML) rendering. It didn’t make sense to me to implement a full template engine on top of another template engine (PHP), and so I came up with Outline. I am comfortable with plain PHP templates, and have been using them for years - I just wanted a thin layer that would shorten the syntax and simplify using some of the PHP-features that are especially useful for templating.

Well, see for yourself and let me know what you think :slight_smile:

thanks for your post [Mindplay],

Your templating engine looks alright, what I was looking for is to trim my HTML+CSS stuff (not necessarily the PHP code). I’ve been looking around and have seen some weird solutions, that’s for sure ;)

I used to use FastTemplate (a very old templating engine) and of course Smarty … but when you work with a team of designers it’s really hard to sell the new stuff, because they (usually) don’t wanna learn new things, or they don’t wanna spend extra time/money learning it.

Just keep it up, if it’s good it will take off sooner or later! If you finished the integration with Yii, please let me know, I can try it out and maybe :) announce it through the Yii Radiio! ( http://yiiradiio.mehesz.net )


Ohhh, right … the truth is, I only ever looked at HAML once, briefly, a while ago, and I guess I got it mixed up with something different.

It’s an interesting concept, but I find that it’s not always accurate enough to specify exactly what I want - I guess I prefer markup, as it’s the native language of the browser, even if it’s more typing. I find that template syntax can reduce repetitive typing a lot - but for really hardcore minimalists, I guess, not enough :wink: