When setting up an application using the Zend Framework the directory structure places the application and library folders in the folder that contains the public_html folder: Some hosts will not give you FTP access to the level above public_html (for example if you are on shared hosting), so this blog post will teach you to move your application and library folders into the public_html folder.
This guide will explain how to set up the NetBeans IDE to work with the Zend Framework. It is worth noting that this guide has been written using NetBeans IDE 7.1 and the process may be different for older/newer versions I make the assumption you have already downloaded and installed NetBeans and also have downloaded a copy of the Zend Framework. Step 1 – Set up the include path First you need to set up the include path within your php.ini file so that the zend framework is always included by default. If you have installed XAMPP via the windows … Continue reading
If you use the Zend Lucene Index feature within the Zend Framework then you may have come accross the “Index is under processing now” error message. This this exception will be thrown when an attempt to open or add to a corrupt index is made. Solution 1. Call optimize(); on the index object periodically. This could be included as part of a cron job that is executed daily for example to prevent potential issues occuring. 2. Handle the exception – if you try to access the index and it has managed to become corrupt, then handle the exception by rebuilding … Continue reading
Mapping in Doctrine 2 is necessary to tell Doctrine 2 which classes are to be saved in the database and which fields in those class will be used for this purpose. This post continues the earlier post which shows how to create Doctrine 2 classes which can be found in our post Doctrine 2 Classes – how to create them and all you need to know. One major benefit to mapping in Doctrine 2 that often gets overlooked is that because mapping is stored in files and is used by Doctrine 2 for building the database schema, this means that … Continue reading
If you have a website built using Zend that has a requirement for a blog section, you can install WordPress in a subfolder to manage the blog. The problem you now have is that you have to edit your database details in two separate locations, the .ini file for your Zend Application and the wp-config file of WordPress. Although this isn’t a big deal it can easily be forgotten leaving to potential issues in the future if some details were to change. This issue is most likely to occur when transferring the site from a local or test server with … Continue reading
Doctrine 2 is a powerful ORM alternative to Zend_Db. Although it is admittedly a little harder to get your head around, the benefits are huge when it all clicks together. This article will teach how to create a Doctrine 2 class to store and get data in a database. A Doctrine 2 class is just a normal PHP class, but with certain requirements such as: Class variables must be defined for each field to be saved to the database. This needs to be either private or protected and should never be prefixed with an underscore. These class variables are the … Continue reading
When an action does not require a layout or view script, it is possible in Zend to disable both resources individually. The code to disable the view renderer and layout can be found below This code can be placed within two different locations in the controller to disable the view and layout scripts. If you want to disable them for a single action then