Developing software in the Real World

Extending Zend_View_Interface for use with Smarty

Zend Framwork v0.6 has introduced new MVC code and one of the changes is that Zend_View_Interface now exists to allow for easy implementation of other templating engines other than PHP based ones like Zend_View or Savant. We use Smarty at work and when we migrate our content management framework to Zend Framework, we intend to continue using Smarty. Hence, I've created AkCom_View_Smarty to play with how we are going to use Smarty within the Zend… continue reading.

Zend Framework Tutorial for ZF v0.6

Now that work's finished for the year, I've finally had time to update my tutorial so that it works with 0.6 of the Zend Framework. There are lots of changes this time to accomodate the new MVC code that Matthew Weier O'Phinney has written. The new MVC system is very simple to use and also very powerful, so I feel that it definitely fits with the stated goals for the Zend Framework.

Version 1.1.2 of the Tutorial

Just a quick note to let you know that I've updated my tutorial to version 1.1.2. This version fixes the include path and a slew of typos that have been found by Brendon Kozlowski. Thanks Brendon! Isn't it amazing that even after all the reading that's been done of this tutorial that there are still typos to be found?!

preg_last_error() returns No Error on preg_match() Failure

A question came up on a mailing list that I subscribe to that I thought interesting. Consider this code:

The output is:

As you can see the pattern passed to preg_match is invalid as it is missing the end delimiter, so intuitively there is an error, but preg_last_error() says that there isn't! This comes about because preg_last_error() only tells you the last error returned from the PCRE library, rather than the last error… continue reading.

Zend_Config Documentation in 0.2

Note that the documentation for Zend_Config is wrong in version 0.2 of the Zend Framework, as awormus has found out! Key things to know: Instantiation $config = new Zend_Config_Ini('file.ini', 'section'); Zend_Config_Array has been removed It's no longer necessary as you can do: require 'config.php'; $config = new Zend_Config($config); Inheritence in Zend_Config_Ini has changed Was:


We'll get the docs sorted soon, sorry! Update:The wiki version of the manual has been updated thanks to Darby!

Zend Framework Tutorial: Version 1.1

It turns out that there are hardly any changes required to make the tutorial code compatible with version 0.2 of the Zend Framework! The only changes I had to make were to the index.php file. The two changes needed were: Zend_Config construction You now create a Zend_Config_Ini directly: $config = new Zend_Config_Ini('./application/config.ini', 'general'); is all that's needed now! Front Controller instantiation For the original tutorial, I needed a special route for compatibility. This is now… continue reading.