Pragmatism in the real world

Top Tip: XHTML with Zend Form Elements

When you render a Zend_Form, the elements will render to HTML compliance rather than XHTML compliance, even if you have < ?php echo $this->doctype('XHTML1_STRICT');?> at the top of your layout script. Practically, this means that all the input elements do not end in "/>". To resolve this, you need to call the doctype() view helper prior to rendering your form. Within my projects, I do this within a front controller plug-in called ViewSetup that looks… continue reading.

Simple Zend_Form File Upload Example Revisited

I've been thinking about the Simple Zend_Form File Upload Example that I discussed last month. To recap, if you haven't read the comments, if the form fails to validate for some reason then you get a nasty error: Warning: htmlspecialchars() expects parameter 1 to be string, object given in /Users/rob/Sites/akrabat/Zend_Form_FileUpload_Example/lib/Zend/View/Abstract.php on line 786 Essentially, what is happening is that the App_Form_Element_File class that we wrote assigns the $_FILES array to the $value parameter for the… continue reading.

A review of "Learning PHP Data Objects"

Packt Publishing recently sent me a couple of books to review. This post is about the second one I received, Learning PHP Data Objects by Dennis Popel. I was excited to receive this book as PDO underlies a lot of the Zend_Db_Adapter objects that I use in my day to day programming. It seemed like a good idea that I should know more about it. Overview of the book This book starts out introducing PDO… continue reading.

A review of "Object-Oriented Programming with PHP5"

Packt Publishing recently sent me a couple of books to review, so let's start with Object-Oriented Programming with PHP5 by Hasin Hayder. According to the introduction, the book is intended for beginners to intermediate PHP5 programmers and the first chapter has a good introduction to what object oriented programming is and why you would want to use it. Overview of the book Chapters two and three of the book are an excellent discussion of how… continue reading.

Flickr Uploadr

The new Flickr Uploadr was written using Xul. Richard Crowley has put up a post at the Flickr blog with links to various articles that he's written about devloping with XUlrunner. Fascinating stuff and a must read for anyone who writes Xulrunner apps. Even better, the full source to Uploadr is available!

Simple Zend_Form File Upload Example

UPDATE: This is out of date. Nowadays, you want to use Zend_Form_Element_File. Zend Framework 1.5's Zend_Form component is missing support for the file input element as it is waiting on a file upload component to build upon. We're busy people, so we'll fake it… This is a super simple example showing how to do file uploads with Zend_Form in Zend Framework 1.5. I'm building on the Simple Zend_Form Example, so make sure you have read… continue reading.

On Mail.app

As I mentioned a while ago, I'm now using a MacBook Pro. All is going well, and I like Mail.app's search and data detectors very much. There are some niggles though that I miss from Thunderbird. My top 3 are: * GPG integration (Thunderbird's Enigmail) * Mail.app's insistence on attached PDFs and images inline * Filing mails to arbitrary folders using the keyboard (Thunderbird's nostalgy) It turns out that there are solutions to all three… continue reading.

Updated Tutorial for Zend Framework 1.5

Zend Framework 1.5 has now been released to mark the occasion I have significantly updated my Zend Framework Tutorial! The tutorial was first released on 16th August 2006 and was written against version 0.1 of Zend Framework and had one major revision to bring in support for the ViewRenderer component. The new tutorial produces exactly the same application as before, but now uses the new 1.5 goodies of Zend_Form and Zend_Layout, so you can see… continue reading.

PHPWM March Meeting: Symfony

On Tuesday, PHPWM had a meeting at PSL Connect's offices where Darren Beale talked about Symfony. I took a few pictures and have stuck them up on Flickr. I should have taken my other lens though as the 50mm isn't wide enough for taking pictures in room! It was a very good talk that covered the basics of Symfony and what it can do. At the start, Darren asked us which frameworks we use and… continue reading.

Site Stats

One thing I get asked a lot about at work is site stats. Usually, the client wants to know how many visitors they get on any other day along with other data such as where the visitors came from and which search terms they may have used. So far, I've used Google Analytics and PHPMyVisites JS based logging along with Analog on the logs themselves. I've also experimented with Mint on one site. Generally, I've… continue reading.