AjaxCore PHP Framework
AjaxCore is a multi-purpose PHP framework that ease the development of rich Ajax applications, by generating the appropriate JavaScript code. AjaxCore takes all the dirty work of JavaScript code generation and provides a solid foundation. The concept is to extend a Generic AjaxCore class and defining methods that handle the Ajax driven events and binding them to HTML objects. It uses Prototype's JavaScript standard library for getting DOM (Document Object Model ) elements and handling asynchronous XMLHttpRequest One distinguish point to remark is that, by letting you Bind events on HTML objects that will execute server side code,it let's you solve any specific requirement without the hassle of coding particular JavaScript code to handle specific events.
AjaxCore is open source project released under Apache License V2.0. Mauro Niewolski, author of the framework, supplied some examples for the common binding options provided with the framework on the release, they are :
- bind ( does a bind between a html object and a php function, when a JavaScript event is triggered )
- bindTimer ( does a bind between a html object and a php function, when a JavaScript event is triggered and timer expires)
- bindPeriodicalTimer ( does a bind between a html object and a php function, when a JavaScript event is triggered and keeps repeating each time timer expires).
The key is, just make a class that extends from "AjaxCore" and define a function to handle Ajax requests, and then bind an HTML object to that function upon a JavaScript event ( like onClick and so on..), you can even assign several JavaScript events to the same PHP function with no hassle. Also, If you have to send some HTML elements values to the PHP function, it's as simple as type the ID of the html element and then retrive it on php with $this->request['elementName'] method, you can even send static values with no HTML ID by appending a (' _ ') prefix to the element, as _XXX=YYY , whether XXX represents variable name, and YYY value.
You can find a live example using AJAXCore Framework. Download AJAXCore available from sourceforge project's page.


Subscribe to AJAX Magazine's feed