Zend Framework Not Wonderful

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
supermike
Forum Contributor
Posts: 193
Joined: Tue Feb 28, 2006 8:30 pm
Location: Somewhere in the Desert, USA

Zend Framework Not Wonderful

Post by supermike »

It's got issues. Zend Forms API is rather limited in what it can do, and it's not realistic for how we freelancers and employed PHP devs do work. I mean, most of us are given an XHTML from a project manager, which he had drawn up by the marketing department or outsourced on the web, and we're told to make it work. But Zend Forms doesn't mix well here because it wants to draw the form for you in its own, extremely limited, markup way. So, sure, you can use an XHTML template, but then you have to rip out the forms and replace it with Zend Forms and approximate what the designer had provided you. But sometimes even styling can't make Zend Forms look the way the previous XHTML template looked like.

Zend Forms also only has a handful of form elements it provides you. Want to use a fancy form element you created that replaces the SELECT tag and simulates it? Forget it. Want to replace the ugly default checkboxes and radio buttons and use some fancy Javascript and DIV tags to achieve the same functionality? Forget it. You see, Zend Forms is like behind the times, trying to give you forms that look sort of like what you would get in the 1990's, not keeping up with the latest trends.

So some people say to use Decorators. Well, the problem with Zend Decorators, besides being poorly documented and very hard, long, and drawn out to use, is that they really are meant for wrapping the existing form elements, not replacing them or putting items before them. And it was only just last night where I found out you can use a Decorator to prepend something, but this is not documented on the web anywhere:

$myElement->addDecorator('HtmlTag', array('placement' => 'prepend','tag'=>'div','id'=>'myDiv'));

...which would insert a DIV (complete with starting and ending tags called myDiv before your element on the page. And again -- this ain't documented. You have to find out on IRC chat, and that guy found it out from another friend, and another, and that guy probably found it out because he knows someone on the development team for Zend Forms. In fact, much of the Zend Forms documentation is missing, and the guys on #zftalk IRC chat admit to that, and so you have to use IRC to get the real scoop.

But then people defend Zend Forms and say that even if you don't use Zend Forms to draw the form, but use XHTML in a View and draw the form yourself, you can still use Zend Forms API to do data entry input validation, error reporting, and input filtering. While this may be true, it doesn't take a PHP developer with 2 year's experience more than 15 minutes to solve that problem on his own in some classes that work exactly the way he wants them, rather than trying to fight with the crazy way that Zend Forms API implements validators and filtering. Sure, some Zend Forms validators and filters are easy, but often you have to subclass and go to town with some crazy logic for other filters, and crack open the manuals, when you could have just written some easy classes with string manipulation and error reporting and moved on.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Re: Zend Framework Not Wonderful

Post by jmut »

Well, perfect time you step in into discussion share your ideas on how stuff should be.... and watch it being done....if most people think like you of course... you can be part of shaping a framework that will be for everyone to use. Frameworks as you already know but not mention is not only to get things done...it's about consistancy as well. I personally am not happy with any other framework so far. Yes, I do believe ZF gives most flexibility and promotes best coding practices. If you want fancy element thats not part of html standard...go ahead...implement one...and use it... If you don't know Decorator pattern..read about it... there is nothing hard to it.
Documentation is poor... I don't think ZF is that mature yet, but I can say it's very very active.....and with your help it can at least have 100 new issue tickets on documentation that will be solved at some point.....if some point is not good enough for you...do it.
I am also sure ZForm can solve at least 90% of cases everyday devloper faces...with relative ease...if not and extend or two make it all work for you. ZF is started from ground 0 and I think it's going very solid...still a lot of heave refactoring is considered to improve the code in v. 2+. I really want to see you do in 15mins what Zend validators and filters provide you. You cannot. Yes you can do "just written some easy classes with string manipulation and error reporting and moved on" in couple of hours but thats it... no flexibility there, no unit test cases, no hundreds of people testing your validators/filters everyday and of course the most important part...nobody forces you use any part of Zend...you can use whatever makes sense and is usable for you.
Bottom line, I don't think there will ever be framework that handle everyone's problems. I personally like ZF , as you might have noticed, and think it's good stuff and can learn a lot from and do tons of work with. What is more... I do think at some point ZF will be taken out as single projects and some custom specilized libs will popup for specific tasks. There is yet to see js/ajax integration with this dojo(yes it will again be flexible to implement with other js libs) and other goodies....so I am very optimistic....
supermike
Forum Contributor
Posts: 193
Joined: Tue Feb 28, 2006 8:30 pm
Location: Somewhere in the Desert, USA

Re: Zend Framework Not Wonderful

Post by supermike »

Oh, and take a look at Magento Commerce -- it doesn't use the Zend Forms API at all either, but does use the Zend Framework.

(And maybe its use of Zend Framework is why the bugger is slow when you load in product data?)
Post Reply