PHP Coding Standards (3) – Coding Style

1. PHP code must always be delimited by the full-form, standard PHP tags. Short tags are only allowed within view scripts.   For example :          2. When a string is literal (contains no variable substitutions), the apostrophe or "single quote" must always used to demarcate the string.   For example :    […]

Posted in Coding Standards | Tagged , | Leave a comment

Singleton Pattern in Zend Framework

The singleton provides a very good solution to the problem when you need an object to be handled as always single and global.   Singleton, which may usually merge up with other patterns (e.g. registry, factory), has been used in creating the independent objects for the application such as session and database connection etc..   Now let’s go and […]

Posted in Design Patterns | Tagged , | Leave a comment

Factory Pattern in Zend Framework

The factory pattern is a simple but powerful design pattern which makes it very easy to manage and maintain plenty of classes.   The factory pattern, as it means, is using some material to provide products. But what we call the factory pattern here is to create the objects by assigning parameters to the producer […]

Posted in Design Patterns | Tagged , | 1 Comment

PHP Coding Standards (2) – Naming Conventions

1. The Zend Framework employs a class naming convention whereby the names of the classes directly map to the directories in which they are stored.   Based on PEAR Coding Standards, we can easily find the right place where the file stored from the class name.   For example : Zend_Acl_Role stands for Zend/Acl/Role.php     […]

Posted in Coding Standards | Tagged , | Leave a comment

Create Captcha Image with Zend_Dojo

Users usually see the captcha and are asked to type the same in order to prove their truth when they are just going to take the registration.   Zend_Captcha in Zend Framework provides this kind of functionalities. Especially Zend_Captcha_Image which allow to show the words within an image has really made it easy.   See example below :     Now […]

Posted in Zend Framework | Tagged , | Leave a comment