Using __call() in your controller to render magic content.

I was writing a basic CMS-type system and I was getting a bit annoyed with long urls, ie: /index/content/page/something, when I really just wanted /content/something – so I thought to myself, “self, why don’t you use __call() and just magically handle the incoming actions? Well, self, that was a brilliant idea. function __call($method, $params) { […]

Posting Defaults for Checkboxes

I was playing around with Zend_Form a little while ago and I realized they did something neat with checkboxes. Everytime I created a checkbox, Zend made two. <input id=”optInDefault” name=”optIn” type=”hidden” value=”n” /> <input id=”optIn” name=”optIn” type=”checkbox” value=”y” /> One hidden, and one not.  This is handy because when the user doesn’t check it – […]

Zend Framework, Rewrite Rules, Apache

Most of the Zend Framework documentation I’ve read recommends a rewrite rule that looks something like this: RewriteEngine on RewriteRule !\.(swf|js|ico|gif|jpg|png|css)$ index.php Why not use a more elegant rule that looks like this: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php This rule basically says: If it’s not an existing file, and it’s not […]

Zend Framework 1.6, and more.

Zend released version 1.6 of their framework just a short while ago and I’ve been reviewing a lot of the changes.  As it turns out this framework is becoming quite large and diverse in what it can do.  Some of the newer features that interest me: Saving sessions to a database table. Dojo integration Captcha […]

Installing PHP Java Bridge on Ubuntu

Source Install First, make sure all php packages are updated — if you update PHP after installing this, it will likely segfault. For the purpose of this, I’m using Ubuntu 7.10, and Java 6 (sun-java6) First, get the build essential, as well as php5-dev, sun java and automake # apt-get install build-essential php5-dev sun-java6-jre \ […]