Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Ajax Component Proposal

Proposed Component Name Zend_Ajax
Developer Notes
Proposers My E-mail Address
Revision 1.1 - 1 August 2006: Updated from community comments. (wiki revision: 6)

Table of Contents

1. Overview

Zend_Ajax is a simple component that allow you to create and some XML which will be consumed by an Ajax engine written in EcmaScript.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • Correctly reads a developers mind for intent
  • Generates strict PHP 5.x object oriented code codifying the read intent
  • Validates code against brain-wave scans before execution (verification)
  • Performs with less than a 5 second lag from though to start of execution

4. Dependencies on Other Framework Components

  • Zend_Exception

5. Theory of Operation

The component is instantiated with a mind-link that ...

6. Milestones / Tasks

zone: Missing {zone-data:milestones}

7. Class Index

  • Zend_Ajax(factory class)

8. Use Cases


... (see good use cases book)

9. Class Skeletons



ecmascript ecmascript Delete
ajax ajax Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 26, 2006

    <p>In my opinion there shouldn't be a new Ajax library just for the Zend Framework. </p>

    <p>Maybe some different backends (dojo, yui, etc.) could be useful. Existing Ajax libraries are so powerful that I don't think a Zend Framework Ajax library could/should keep up with them. At least I don't see a point in reinventing the wheel here.</p>

    <p>At the moment you hear about so many new Ajax libraries. It seems like everyone is working on one. Shouldn't we know better?</p>

    <p>But maybe I'm missing out on something here. Please let me know if that's the case.</p>

    <p>Just my 2 cents.</p>

  2. Nov 28, 2006

    <p>The purpose is not to create another Ajax library, but to use one as easily as possible.</p>

    <p>We can imagine to use a special tag (like jstl way) or calling a special method to put a tooltip on a dom element. (no ajax here)</p>

    <p>We can also use more complex components as clearly as possible, php developpers don't really want to manipulate ajax concept or ecmascript code.</p>

    <p>In my example I want to use a complex DHTML table which could be loaded partially with ajax request. The goal is to create a simply piece of code to manage all ajax requests.</p>

    <p>I understand that there is a lot of powerful library, but powerful doesn'tmean useful when there are too complex to use...</p>

    <p>I've so less time at the moment and I can't code it, perhaps during my next holidays ..... or I will delete this proposal until it was done. </p>

  3. Dec 20, 2006

    <p>If you think there should be a Zend_Ajax component, then it might be in your best interest to first come up with an actual proposal, <em>then</em> post it. Instead of a name and a one-line description. <ac:emoticon ac:name="smile" /></p>

    <p>I've written up my thoughts here:
    <a class="external-link" href=""></a></p>

  4. Feb 21, 2007

    <p>i would have to agree that an Ajax component is not required, and the existing framework can utilize it. your Ajax calls only have to request a controller / action that action can use the built in JSON functionality and just echo it to the screen, its really that simple, no need to add more complication to the server side, i think the time spent developing such a framework when their are all already so many good ones <strong>cough</strong> JQuery <strong>cough</strong> , could be better spent developing / improving other core functionality.</p>

  5. Mar 17, 2007

    <p>In general, I'd suggest to have a look at symfony. I like the isAjaxRequest-helper (it's called something like that) where you check inside your action where the request comes from and send a response based on it. "where" in terms of regular request, or "inline" (xmlhttprequest and so on).</p>

    <p>I think this is necessary before all.</p>

    <p>Aside from that people know how to load a client-side JS-lib themselves. After all that's plain-old HTML. Of course you could add a "helper" which adds that to your page' <head>. But the ZF shouldn't rely on a specific lib, since everyone has his personal preference. Be it jQuery, prototype or whatever.</p>

    1. Mar 19, 2007

      <p>That's a good idea. I've put in a JIRA issue for Matthew to add this to <code>Zend_Controller_Request_Http</code>.</p>

  6. Jul 05, 2007

    <p>I think the easiest way to use AJAX within a PHP framework is to let the user define his AJAX functionallity in PHP.</p>

    <p>Just image you would have a special type of controller class that "exports" its functionallity to a javascript object. On the browser side this javascript object can be used to fire up methods of that controller.</p>

    <p>I was searching very long for such a type of AJAX implementation for PHP. After I did not find it I decided to implement it on my own. It's ready and works great! It has a lot of features that can be used, but don't need to be used. For example: synchronous and asynchronous calls, specifying timeouts, custom error handlers, full implementation of JSON-RPC, true type conversion of arguments, synchronous calls just have the return value of the controller method as return value of the javascript function call, asynchronous calls call a callback function on the javascript side with the return value of the controller method as parameter...</p>

    <p>Users do not need to have special knowledge about javascript. Knowing how to call javascript functions is all you need to know to use it.</p>

    <p>I think about to porting it to ZF. Would anybody be interested?</p>

    1. Jul 30, 2007

      <p>Hmm,<br />
      I am very interested.<br />
      I'm new on ZF but I really miss this kind of stuff.</p>

      <p>Like people said, not a lib that creates Ajax applications, but helps to create one.</p>

      <p>Can you upload your implementation for us, to see how really works?</p>

  7. Aug 29, 2007

    <p>If you want to use Ajax on the Zend Framework try using the Prototype framework and use Zend_JSON to send it data.</p>

    <p>AJAX in 2 lines of Javascript!</p>

    <p>The Zend_HTTP_Request also has a nice function for checking if requests are AJAX requests! SOOO, if your application is a well structured MVC implementation you can intercept all calls at the controller level and return the model to a special AJAX view (i.e. JSON up the result and return it.)</p>

    <p>So every controller action can be done via AJAX too!</p>