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
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
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
Reloading/Refreshing the current page in Zend To reload the current URL you use the redirector helper in the controller action you wish to reload with the following code: $this->_helper->getHelper(‘redirector’); To get the exact current url so that the current page is reloaded you use the getRequestUri method as shown below: $this->getRequest()->getRequestUri(); To put these to pieces of code together to reload/refresh the current page you would use the following line of code. $this->_helper->getHelper(‘redirector’)->goToUrlAndExit($this->getRequest()->getRequestUri()); This will reload/refresh the current page with the exact same URL including all parameters so display differences such as database changes for example.
Sometimes, say on large projects with thousands of pages there may be a need to dynamically check the HTTP response of pages to identify 404 and 500 errors for example. This custom class checks the HTTP response using cURL and returns it at the end of the function. All you need to do is call it and pass the URL you wish to check into the class as a parameter. For example: The value the HTTP response is now stored within the checkURL variable and can be accessed as you wish. Below is the custom class PageStatus which contains the … Continue reading