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 (http://ajason.sourceforge.net/) 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 (http://ajax.zervaas.com.au/) 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 (http://ajax.zervaas.com.au/).

A.14.3. Cajax

Cajax (http://sourceforge.net/projects/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 (http://www.htsdesign.com/index.php?&section=htswaf&page=index) 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 (http://www.htsdesign.com/index.php?&section=htswaf&page=index).

  • Currently in demo stage, by Bert Rosell.

A.14.5. JPSpan

JPSPAN (http://jpspan.sourceforge.net/wiki/doku.php) passes JavaScript calls directly to PHP functions.

  • Heavily unit-tested

  • Open source license

A.14.6. PEAR::HTML::Ajax

PEAR::HTML:Ajax (http://pear.php.net/package/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 (http://livepipe.net) 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 (http://www.symfony-project.com) integrates a server-side Ajax layer together with helpers "à la" script.aculo.us, to provide an easy way to build Ajax applications in PHP.

  • A step-by-step tutorial is available (http://www.symfony-project.com/tutorial/symfony_ajax.html) describing the creation of an interactive shopping cart. This demonstrates the tight integration of prototype, script.aculo.us, and the MVC model.

  • The Advent Calendar initiative (http://www.symfony-project.com/askeet) 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 (http://www.askeet.com) they are building live. A must see.

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

A.14.9. XAJAX

XAJAX (http://www.xajaxproject.org) 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 (http://www.xoad.org) 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 (http://www.phpclasses.org/winners.html).

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




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

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net