Section A.14. PHP Ajax Frameworks

A.14. PHP Ajax Frameworks

PHP frameworks tend to focus more on remoting than HTML generation. XOAD is one popular remoting library, as well as CPAINT and SAJAX (covered earlier in "JavaScript Multipurpose Frameworks").

A.14.1. AJASON

AJASON ( is a PHP-based framework.

  • Uses JSON (JavaScript Object Notation) to encode/decode data between server and browser

  • Open source license by multiple contributors

A.14.2. AjaxAC (from April, 2005)

AjaxAC ( encapsulates the entire application in a single PHP class.

  • All application code is self-contained in a single class (plus any additional JavaScript libraries).

  • Calling a PHP file or HTML page is very clean. All that is required is creating the application class, and then referencing the application JavaScript and attaching any required HTML elements to the application.

  • Built-in functionality for easily handling JavaScript events.

  • Built-in functionality for creating subrequests and handling them.

  • Allows for custom configuration values, so certain elements can be set at runtime.

  • No messy JavaScript code clogging up the calling HTML codeall events are dynamically attached.

  • Easy to integrate with templating engine.

  • Easy to hook in to existing PHP classes or MySQL databases for returning data from subrequests.

  • Extensible widget structure to be able to easily create further JavaScript objects (this needs a bit of work though).

  • Open source license (Apache 2.0) by Zervaas Enterprises (

A.14.3. Cajax

Cajax ( is a PHP object-oriented framework that creates and handles server-side requisitions though JavaScript remote calls. Some features are:

  • Simple server-side programming

  • Almost no client-side programming (less JavaScript writing is possible)

  • Handler for server-side events

  • A suggest handler like Google's

  • Plugin for multiple selects (like country/state/city)

  • Remote server calls directly from JavaScript, using an abstraction layer

  • Plugin for submitting forms though XMLHTTPRequest

  • JavaScript caching

  • Open source library (LGPL) by Thiago Pappacena

A.14.4. HTS Web Application Framework

HTSWaf ( provides seamless client-to-server event handling.

  • The HTS Web Application Framework is a PHP- and JavaScript-based framework designed to make simple web applications easy to design and implement. The framework implements a custom tag engine with an automated JavaScript and/or PHP event model and automates the transfer of data to and from the server.

  • Visit the web site for more info and examples (

  • Currently in demo stage, by Bert Rosell.

A.14.5. JPSpan

JPSPAN ( passes JavaScript calls directly to PHP functions.

  • Heavily unit-tested

  • Open source license

A.14.6. PEAR::HTML::Ajax

PEAR::HTML:Ajax ( is a PHP and JavaScript Ajax library.

  • Provides PHP and JavaScript libraries for performing Ajax (communicates from JavaScript to your browser without reloading the page).

  • Offers object-oriented (OO) proxies in JavaScript of registered PHP or proxyless operations.

  • Serialization of data sent between PHP and JavaScript is provided by a driver model. Currently JSON and Null encodings are provided.

  • Open source license (LGPL) by multiple contributors.

A.14.7. Pipeline

The Pipeline framework ( consists of a simple client-side library and direct integration with the controller. It's main focus is on simplicity, it is not feature rich, and does not use XML. It favors returning HTML or Strings from the controller, or associative arrays that get translated from PHP into JavaScript.

  • Open source license with commercial add-ons in development by Picora Pipeworks.

A.14.8. Symfony

Symfony ( integrates a server-side Ajax layer together with helpers "à la", to provide an easy way to build Ajax applications in PHP.

  • A step-by-step tutorial is available ( describing the creation of an interactive shopping cart. This demonstrates the tight integration of prototype,, and the MVC model.

  • The Advent Calendar initiative ( illustrates how to build a real Ajax application in 24 short tutorials, complete with downloadable code. Interactive form submission, Folksonomy, and visual effects are some of the Ajax features of the askeet web site ( they are building live. A must see.

  • Open source license (MIT License), sponsored by Sensio.

A.14.9. XAJAX

XAJAX ( passes JavaScript calls directly to PHP functions.

  • Use JavaScript stubs to call functions, object methods, and class methods in a PHP script.

  • The response is created using the XAJAX response object, which provides numerous commands, such as assigning HTML to an element, displaying an alert, and more. Custom script output is also supported.

  • All browser-specific code (such as using XMLHttpRequest) is abstracted, and sending various types of data to the server (including form submission via Ajax) is very easy to accomplish.

  • It supports a number of configuration options to allow easy integration with existing web apps and frameworks.

  • The JavaScript core is easy to understand and can be overridden to support more advanced JavaScript functionality.

  • Well-supported via forums and a new wiki with documentation and tutorials.

  • Open source license (LGPL) by J. Max Wilson and Jared White.

A.14.10. XOAD (formerly NAJAX)

XOAD ( is a PHP-based Ajax/XAP object-oriented framework.

  • It uses JSON Messages and native PHP serialized objects to communicate.

  • Special attention has been paid to security.

  • Supports server-side events (Distributed Events [Chapter 10]).

  • Supports client-side events (XOAD Events).

  • Supports server and client extensions.

  • Supports HTML manipulation (extension).

  • Supports caching (extension).

  • Each class, method and variable is documented.

  • Provides easy tutorials to get started using XOAD.

  • Provides examples that demonstrate various functionality.

  • Won the PHP Programming Innovation Award of August of 2005 (

  • Open source license (PHP 3.0 license) by Stanimir Angeloff.

Ajax Design Patterns
Ajax Design Patterns
ISBN: 0596101805
EAN: 2147483647
Year: 2007
Pages: 169

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: