PHP and Smarty First Impressions
Recently I’ve begun work on a newer, cooler, better, version of Costumzee.com with the elite hax0rs over at Mech Media. Scott and I decided to utilize a php temple engine called Smarty for better separation of code and presentation.
A couple things worth noting before I dig in here:
- The extent of my PHP knowledge is minimal - what I know of PHP is what I’ve done when tinkering with WordPress
- My knowledge of backend web development is also minimal. I’ve been a frontend guy my whole web career. I pwn xhtml/css/javascript, but server-side dev is completely new to me (I’m finally nipping that knowledge-gap in the butt).
- I do have knowledge of template engines. When I worked on Quibblo.com full time, we used the Perl Catalyst Framework and I got savvy with Template Toolkit which allowed me to dive into Smarty fairly quickly.
- The {debug} function. At the drop of a hat I can see everything available to me and integrate it on the front end (.tpl files).
- Plugins. I needed a way to paginate, and with minimal knowledge I was able to leverage SmartyPaginate to get the job done.
- I was productive day 1. It’s PHP (which is not a challenging language to begin with) and there’s a separation of code and presentation. I’ve dabbled with ROR, and the learning curve of doing something productive, interesting, and unique is just so much easier, because you don’t have to worry “am I doing this the way they want me to?”.
- Smarty documentation is awesome. It’s brief and concise with really world useful examples. When I do get tripped up with something Smarty related it’s a matter of referencing the documentation and in a couple minutes I’m on my way.
The very few things that I’ve gotten stuck on have been mostly due to a lack of my PHP knowledge and not so much a result of issues with Smarty so far. And unique to my situation, I had Scott right there to bounce questions off of when I hit a wall which was also great.
All in all it’s a great to leverage a templating engine like Smarty when you’re beginning to learn more about backend web development. I’ve always shied away from it because I was always working with other programmers that were more than capable in that area and my talents were always restricted to the front-side of the glorious interweb.
I was never interested much in PHP. I always felt like the future of the web was with a framework like Ruby On Rails, but I am pleasantly surprised with my Smarty experience so far and it’s made me excited to develop with PHP more down the road.
Currently, I’m developing with ROR and Smarty and I hope to compare and contrast the two in the future, stay tuned.
Popularity: 11% [?]

Yeah, I totally agree the learning curve for ROR is a little steep. Even coming from a background with C/C++/C# and knowing back-end development, I’ve asked the same “am I doing this the way they intended” when developing ROR apps. Maybe at some point I can take a look at that Smarty stuff. It’s always cranked to learn new stuff!
left this nugget of wisdom December 1st, 2007 at 2:16 pm
speaking of 1337 hax0rs, did you see what MacHeist.com pulled on the wordpress dev community?
left this nugget of wisdom December 6th, 2007 at 8:55 am
my stupid url, didn’t post. in don’t know how to insert hrefs….
http://tinyurl.com/2xawho
left this nugget of wisdom December 6th, 2007 at 8:55 am
oh, and i use commas, unnecessarily.
left this nugget of wisdom December 6th, 2007 at 8:56 am
Post comments often? Haha.
Seems like MacHeist is always in the crosshairs. I remember a while back people were bitching because they gave the actual makers of the software they bundled next to nothing for their wares.
left this nugget of wisdom December 6th, 2007 at 10:09 am