After considering several days, I planned to learn Zend Framework. Actually, I had generated this idea since I graduate in last December. But I was confused about the process of setup. It seems that Zend Framework is powerful, but at the same time, you need to tolerate the complicate installation procedure.
Recently, I came across some tutorials on the web, and I finally, finally got it set up. I tried it on NetBeans 7.0 and Zend Studio.
It would be much easier when you use Zend Studio which would automatically help you set up the architecture if you choose ‘File’->’New’->’Zend Framework Project’.
The project structure looks like this
The files under public/ directory are the web pages for this application. Also, it should be noted that the project contains ‘models’,’views’, and ‘controllers’ folders.
Previously, when I tried this, I got error when I launched the browser with url access to index.php under application/public/ directory. I found out that it was the reason that the project missed the Zend library, which can be downloaded here. I downloaded the zip file and extract the contents under library/ directory to the project library/ directory. Then it works!
The index page would like this:
I accessed to this result by this url: http://localhost:8080/zend/public/, where zend is my project name.
Also, the url: http://localhost:8080/zend/public/index would have the same result because index under public/ directory is the a default action within a controller called Index.
For NetBeans IDE, the process is a little bit complicated. It is easy to find the way to create a new PHP application. After setting some necessary parameters such as project name, php version…, you have the option to select one framework. But it would invoke a alert which says that a zend script is required. Use the ‘Browse’ option and go to the folder of zend framework which was downloaded before and select ‘zf.bat’ and at the same time, you need to make sure that the Zend library is in your ‘\php\PEAR’ directory. In my case, I copy the ‘library/’ contents to ‘C:\xampp\php\PEAR’
After this, don’t forget to click the ‘Register Provider’ button just below the zend script line.
And, All the stuffs are set!!
The project structure is the same as Zend Studio one. And also, the result of launching the project is also the same.
Now, I would spend some time to study Zend Framework MVC. I want to share a good tutorial which is in PDF format. I t can be downloaded in http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf
Also, the author provides some resources such as the sample codes for this tutorial: http://akrabat.com/zend-framework-tutorial/