Different PHP template engines

Tags:

Originally posted in my old blog at My Opera

While working on the Smarty View Helper solution I mentioned in the previous post, I went through a lot of Smarty's code and I also did some searching on their forums.

Smarty's code isn't very modification friendly and they had discussed associative array support for Smarty in their forums in 2003 – That's 4 years ago, and they still haven't got it in Smarty!

So, this got me thinking what alternative template engines are available. If Smarty hasn't got any real new features in a long time, others should have them. Right?

Here's a list of template engines I'll review and compare to Smarty, some more in depth than others: Blitz, patTemplate, vlibTemplate, SmartTemplate, Expose, Savant and PHPTAL.

Read More

The best Smarty + Zend View Helpers solution!

Tags:

Originally posted in my old blog at My Opera

Coming on again with the Smarty and Zend View related articles, let's this time take a look at how to get Zend's View Helpers running with Smarty.

Other examples for this that I have seen use a syntax like this: {helper helper=Url p='array(something)' p2=stuff}, which is kind of ugly and the array parsing is done with eval, and we know that Eval is Evil.

Wouldn't a more elegant solution let you use helpers just like you use Smarty plugins? In the style of just typing the name of the helper and simple parameters? Let's see how to make that happen!

Read More

Common Zend_Filter_Input problems

Tags:

Originally posted in my old blog at My Opera

Zend_Filter_Input, while a very useful component of the Zend Framwork, has some oddities that can cause a lot of headache if you can't figure it out right away.

  • Missing fields show up as valid even if they have validators that won't let empty values through
  • NULL values for existing fields

to name some.


Read More

Mozilla Prism: A fancy name for a technology as old as the browser

Tags:

Originally posted in my old blog at My Opera

Mozilla recently introduced Prism, which takes Widgetize to a whole new level.

Opera's Widgetize will turn your blog or RSS feed into a widget with some custom skins and stuff.
What Prism does is, it takes any website and turns that into a self-contained little browser.

While having GMail or such as a “stand-alone” application might sound nice, doesn't this remind you of something? Browsing without tabs.

You don't need a stand-alone application for this either. You could just use Opera to achieve a very very similar experience.


Read More

Simple and efficient spam prevention techniques

Tags:

Originally posted in my old blog at My Opera

I've previously outlined some alternative methods for CAPTCHA/spambot prevention in Different kinds of CAPTCHA.

Josh Clark recently posted Seven Habits of Highly Effective Spambot Hunters which gives even more good methods for preventing spam.

But with spambots gaining more and more features, what can we do to effectively prevent them, while still keeping our methods usable by most people and easy to code for us?


Read More

Handling Ajax requests in the Zend Framework

Tags:

Originally posted in my old blog at My Opera

Doing Ajax is quite simple these days with the various JavaScript libraries offering easy ways to do it. But how do you do it on the server side, without complicating things too much?

Typically, in addition to the Ajax response, you need a traditional page response to a request as well – for example, for browsers which don't support Ajax.

Let's look at some methods how one can detect if a request is an Ajax request and how to respond to them in the Zend Framework.


Read More

What kind of software is needed at a LAN party?

Tags:

Originally posted in my old blog at My Opera

So, the Solid Fireparty is over now and I'm back home. Something like 1200 kilometers driven. I have also posted some photos to the photo gallery and more can be found at http://fireparty.org/lanikuvat/, so check it out.

Getting back on the usual topics, let's look at what kind of software is needed at a LAN party.
There were something like 300-340 visitors at the event, and we had various web-based systems running. I'm going to describe them a bit and some other applications that could come in handy at a slightly larger event like the Fireparty.


Read More

Going to Helsinki

Tags:

Originally posted in my old blog at My Opera


I'm going to Helsinki today, to the Solid Fireparty LAN, to help with the event organization and to do other LAN-party'ish things, whatever they are. I might not post anything from the usual topics for the rest of this week, but stay tuned for photos from the trip (Oulu to Helsinki = 600km, something like 7 hours in a car if driven non-stop) and from the event itself.

LAN party place reservation

Tags:

Originally posted in my old blog at My Opera

Let's take a look at one of my biggest PHP projects so far: Reservinator 1.0, or in other words, a very advanced place reservation system for LAN parties. The page is in finnish, but the post is not, so read on!

If you've even been to a LAN party, you might've used something similar to this system. Amongst other features, Reservinator let's you view an overview map of the event location, choose your place by clicking the place you wish to reserve, and sign up for competitions.

It also has various admin tools, such as sending email to users, marking their reservations as paid based on the bill reference number, and biggest of all, building the overview map with a very easy to use drag and drop interface for placing rooms, tables and other things.

Read More