PHP Coding Standards (1) – File Formatting

1. For PHP files the closing tag ("?>") is to be omitted. It is not required by PHP, and omitting it prevents trailing whitespace from being accidentally injected into the output.   In fact the problem comes when you don’t use gzip or output buffering in php :    // php.ini – Turn off compress […]

Posted in Coding Standards | Tagged , | Leave a comment

Practise dojox.grid.DataGrid with Zend_Dojo

Zend_Dojo was released together with Zend Framework 1.6 as well as Dojo toolkit package. We can make a good experience of the client-side with powerful Dojo components through a simple API provided by Zend_Dojo.   I had tried one very simple example of dojox.grid.DataGrid using Zend_Dojo and Zend_Dojo_Data few days ago.   You can place […]

Posted in Zend Framework | Tagged , | Leave a comment

Multi-modules and multi-templates application for Zend_Application

At the very beginning I need to introduced everybody of Zend_Application before doing anything. As one of the most important big changes in Zend Framework 1.8, the Zend_Application has introduce two new concepts (new to Zend Framework) – Bootstrap and Resource, which greatly simplifies the construction of applications. It can be said that the Zend_Appication […]

Posted in Zend Framework | Tagged , | 2 Comments

Iterator Pattern in Zend Framework

The Iterator design pattern has provided a common mechanism for accessing collections. It allow user to traversal, access, and manipulate data sets, such as array, files, RSS feeds and database result sets etc., in the same way.   One of the progresses which php5 compare to php4 is that it encapsulates a variety of iterator […]

Posted in Design Patterns | Tagged , | 1 Comment

Strategy Pattern in Zend Framework

In the traditional process-oriented languages are often filled with a lot of if/else statements. This situation has easily made the logic of chaos and trouble to amend. The strategy design pattern was borned to solve this kind of problems.   When we face a problem which got serveral solution strategies, we can use the strategy […]

Posted in Design Patterns | Tagged , | Leave a comment