Rabu, 11 Juni 2008

COMBINING CAKEPHP AND THE ZEND FRAMEWORK


The Zend Framework definitely takes a different approach than many of the other PHP frameworks (CakePHP, Zend, CodeIgniter, etc.). It really ends up being more of a collection of libraries than the others do.

In some ways, that makes positioning the Zend Framework as being substantively different from the libraries in PEAR. If you look at what the framework does, there’s not a lot of difference between it and many of the classes in PEAR. I’ll leave it to the reader to decide if these libraries were bundled into a “framework” because frameworks are the hot PHP topic right now or because they really wanted a cohesive approach to web development.

All of that aside, there’s some really useful stuff in the Zend Framework, like the Google Calendar stuff I mentioned a couple of days ago. The fact that ZF does come packaged as what amounts to a PEAR package means you can actually fairly easily use those interesting bits from inside *other* PHP frameworks.

One of the reasons I was messing with the Google Calendar stuff in the first place is that I’m *also* messing with CakePHP to build a homegrown solution for time tracking, invoicing and revenue projection for my consulting business. It’s helpful to be able to mark days like holidays and planned vacations as non-billable so you don’t include them in projections.

At any rate, I went looking for information on including bits from the Zend Framework in my Zend project. It ends up being really simple. This older article covers it pretty well and gives you an idea of how to provide “vendor” wrappers around other 3rd party PHP libraries as well.

Tidak ada komentar: