views:

434

answers:

2

The context is that I don't want to use Zend MVC - controllers, helpers, decorators etc - that's overkill for what I am writing.

I've scoured the jQuery site plugins section and these issues bother me most:

  1. I have to search a lot for plugins - it is tedious.
  2. I have to check dependencies with jQuery versions. Thankfully I decided to stick with only jQuery or noConflict() would have driven me crazy.
  3. I have to hook-up all the id's and names of form elements across HTML+CSS+JQuery through Controllers, Views etc.
    And all this because there is no other simpler PHP wrapper over jQuery plugins than ZendX_JQuery - and plugins is where the attractive scripts and effects are.

  4. Writing a in-house replacement to ZendX_JQuery will be a huge task in itself. But if you have to wrap third party jQuery plugins in PHP and maintain the thing it is full time job in itself.

So I want to know if Zend_Dojo is much easier than ZendX_JQuery. I'm asking before trying out because I'd have to spend a couple more days installing, configuring and testing all the standard Dojo controls and then I can decide. All that's tedious for a rather simple app which may grow later on.

The alternative would be a "jQuery-inside" PHP widget library that is stable and will work for a year without being broken or upgraded.

Something like GWT or ZK or ASP.Net where you don't have to do low-level HTML+jQuery coding and hand-tweaking for every page with all the ajax controls and form elements.

Or should I just drop an MVC framework altogether and replace it with a custom set of scripts only using Zend components where necessary - like Zend_Validate, Zend_Form etc.

I've been working on desktop apps for some time and the switch to AJAX + MVC + Zend is proving a bit too unwieldy, especially given the abundance of design patterns in Zend MVC.

A: 

My recommendation would be to use neither ZendX_JQuery or Zend_Dojo. By the sounds of it, that's overkill for you as well. My thoughts may be coloured by the fact that I don't like to mix PHP and JavaScript code except where absolutely necessary - yes, it may be easier to let a component write your JavaScript for you, but it's never going to be as clean as you could write it yourself.

That way, you also maintain separation between behaviour and presentation - always a good thing, as it makes it easier to use the concepts of progressive enhancement.

Stephen Orr
Actually, having seen ASP.Net, TIBCO GI, Rialto, Bindows, GWT, Visual Webgui, I expected a RAD toolkit from Zend. But i think they've deliberately kept that space open for the PHP community to innovate. That's the only explanation I can see. Either that or I don't know much of Zend_Dojo right now to call it RAD. Meanwhile I did find some RAD toolkits with commercial licenses. I think Zend has good reasons for leaving out RAD while making a framework so vast and powerful.
namespaceform
One of my initial complaints when I first started using ZF was how Zend were sitting on the fence by not providing even a "recommended" layout for applications. No file structure, no guidance, just a list of components that can be used together.Since then, they've released Zend_Application and other parts that just make life easier. I still prefer CakePHP, but ZF is at least enterprise-friendly (meaning it uses lots of buzzwords that sound professional but don't mean very much at all).
Stephen Orr
A: 

I agree with Stephen Orr- I use neither jquery nor dojo (after trying both). I use Zend_Form filters / decorators heavily because client side validation has to be redone on the server side anyway. With some custom decorators, you can do it all in html/php.

I try and avoid ajax where possible, and use prototype / scriptaculous where it cannot be avoided. They are lightweight and provide handy shortcuts to use in other JS code.

Steve