trying-out-zend-framework-1-12-0

2012-09-22T16:49:14.000Z
Tags: zend frameworks php programming

For some time now I have been wanting to upgrade to the latest version of the zend framework. I looked in my downloads folder and found that I had tried this before but this time I was determined to explore the latest version.

I decided to check if I had the latest and greatest and found that now zend has 2 families of versions a v1, and a v2, the v2 seemed to be quite a bit different and I don’t think I was ready to make the leap, as it was not backwards compatible and introduces a lot of new concepts such as dependency injection, so I decided instead to try out the latest v1.

I did some more research and found that for v1 the last version is 1.12.0. This version contains some bug fixes, as well as some new mobile features to support things like mobile push. I followed the quick start tutorial on the site and they introduce a tool called zf, which is a command line tool that can build the skeleton of your app.

In the past I would just take one of my previous zend projects and remove files from it and build on top of it. This left the new project with a bunch of legacy things that may or may not be used in the the new application. It also took quite a bid of time to get it to a some what clean state. Zend can be quite a bit overwhelming to get started, especially since the file structure has a lot of different components.

By issuing a few commands I was up and running. The sample app that is build touches almost all aspects a simple app so ones that was all working I started to introduce a few things I have done in my other zend apps.

One of the things that is difficult to deal with is forms, well rendering them the way you want. However I have had success using custom form layouts with form decorators and I wanted to make sure this was still possible using the new version.

I tried this out with a simple login form, I used the zf tool to generate my skeleton auth controller and login form. I then went ahead and created a decorator form for the login and gave it a shot and it worked. I then tried using my custom login component classes which I use to authenticate and and authorize usage of methods within controllers and that worked as well.

The model as explained in the tutorial is also a bit more involved it contains 3 files a model, a model mapper and dbtable and you have to define your model in the model file and in the mapper file you define your dao methods and the dbtable maps to the actual database table.

In my old model I also have 3 files however I only code the dao file and very rarely ever do I actually put code into the model file. My workflow allows me to be a little quicker when building my model but it lacks some type checking and at this point I have not had time to decide which method I like better.

The other things I use a lot are view components such as paginator and the ZendX view components especially the jquery calendar, however at this point I think they will work as expected. The next steps for me are to start migrating one of my apps to use the new framework and take advantage of some of the the new features which I want to use for mobile notifications.

Last Updated: 5/21/2019, 12:58:44 PM