Book Review: Zend Framework 1.8 Web Application Development
I wrote a quick review for the book Zend Framework 1.8 Web Application Development on Nettuts+, please go check it out if you’re looking into developing with Zend Framework. :)
I wrote a quick review for the book Zend Framework 1.8 Web Application Development on Nettuts+, please go check it out if you’re looking into developing with Zend Framework. :)
Even though the method outlined in my previous post would still work, I thought I’d post a cleaner one to handle the auto-load of Zend Framework classes in Kohana.
The code works with Zend Framework 1.8+, where a new Autoloader class has been introduced.
You can put the code in an appropriate place in your application, it could be in the base controller, or if you’re using Kohana 3.0, in the bootstrap file.
You now no longer need to manually ‘include/require’ Zend Framework files. :)
if ($path = Kohana::find_file('vendors', 'Zend/Loader')) { ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.dirname(dirname($path))); require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance(); }
Since my previous post on this topic, Kohana has evolved and changed quite a bit, to the point that the instructions provided are no longer applicable.
So here are the updated instructions for those who would like to integrate Zend Framework into Kohana.
1) Put the ‘Zend’ folder in your application’s ‘vendors’ directory.
2) Put the following code into an appropriate place in your application, it could be in the base controller.
if ($path = Kohana::find_file('vendors', 'Zend/Exception')) { ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.dirname(dirname($path))); }
3) Instanciate the Zend library with the following code:
require_once 'Zend/Mail.php'; $mail = new Zend_Mail;
That’s it! How simple is that? :)
Two weeks ago I started working with Zend Framework at work. I chose to use Zend Framework for one primary reason: Zend. Even though I have plenty of experience with CodeIgniter and Kohana, I simply could not take any risks using them for a rather large project at a company I had just joined.
My experience so far is mixed. Probably because I am so used to the way CodeIgniter and Kohana do things, Zend Framework just appears utterly complicated and difficult to work with (at the beginning).
And alongside with the new release, they have revamped their website too.
The website looks better than before, but… oops… that happened when I tried to use the search box:
They have now included a quick start guide which is awesome. For some reason though, I still can’t find a change log on their website.
In my opinion the new website is still horrible to use, the home page is more confusing than ever (huh? why is the roadmap under ‘Give Back’?). I guess the designer didn’t read Steve Krug‘s Don’t Make Me Think. ;)
It feels very ‘Microsoft’y… fingers crossed…
Here is a brief overview of the system workflow:
Of course the actual system will be a lot more complex due to cross-referencing components, modules, libraries, helpers, but you get the idea. :)