Tag Archives: zend

Use adapter with Zend_Db

Description: Return a selection of database table fields using the Zend_Db adapter with Zend Framework Solution It’s easier to create an adapter of the database table class and use it in returning the desired values. This grants speed, clean code … Continue reading

Posted in Best practices, SQL, Zend Framework | Tagged , , | Leave a comment

Get current and past month with Zend Date

Description: Return current and previous months in Zend Framework, considering passing into a new year as well. Solution: Zend Framework, through Zend_Date() offers a quick solution for this problem. With the get() function we can return any part of the current date, and with … Continue reading

Posted in PhP, Tools, Zend Framework | Tagged , | 1 Comment

Send e-mail with attachments in Zend Framework

Description: Send an e-mail containing attachments with Zend Framework. Solution: Zend offers an easier solution for sending e-mail with attachements than plain PhP.  Basically the object has to be instantiated and then just configuring the parameters. Example: $email_body = “<div>Body … Continue reading

Posted in PhP, Tools | Tagged , , | Leave a comment

Create service class in PHP with Zend Framework

Description: Communicate between modules in MCV architecture like PhP’s Zend Framework. Solution: Communication between modules, in MCV architecture should not be done directly by calling the model class, but accessing a service class assigned to the model. A service class represents … Continue reading

Posted in Best practices, PhP | Tagged , , , , | Leave a comment

Zend Framework coding standards

Description: Guideline for coding in the Zend Framework. Solution: Use the following coding standards, derived from the original coding standards inherited from http://framework.zend.com/manual/en/coding-standard.overview.html : Class names: Classes_Upper_Case Function names: camelCaseFunction Constant names: CONSTANTS_USE_CAPITAL_LETTERS Configuration: UTF8 Return parameters(no direct $_GET or … Continue reading

Posted in Best practices, Script | Tagged , | Leave a comment