Tuesday, September 20th, 2005

NAJAX 0.4: PHP Ajax Framework

Category: JavaScript, PHP, Toolkit

A new release of Najax 0.4 has been announced. Najax is a PHP based Ajaxian framework that allows you to map server side functions into JavaScript.

Code Example

FirstClass.class.php

<?php
class FirstClass {
	function toUpper($str) {
		return strtoupper($str);
	}

	function najaxGetMeta() {
		NAJAX_Client::mapMethods($this, array('toUpper'));
		NAJAX_Client::publicMethods($this, array('toUpper'));
	}
}
?>

Client Page (index.php)

<?php
require_once('FirstClass.class.php');
require_once('najax.php');
NAJAX_Server::allowClasses('FirstClass');

if (NAJAX_Server::runServer()) {
	exit;
}
?>
<?= NAJAX_Utilities::header('.') ?>
<script type="text/javascript">

var obj = <?= NAJAX_Client::register(new FirstClass()) ?>;
obj.onToUpperError = function(error) {
	alert(error.message);
	return true;
}

obj.toUpper('Hello World!', function(result) {
	alert(result);
});
</script>

Online Samples

Exam Taker

najax-exam.png

File Explorer

najax-fileexplorer.png

Documentation

Posted by Dion Almaer at 12:43 am
3 Comments

+++--
3.7 rating from 10 votes

3 Comments »

Comments feed

I’m trying this library and found it excellent.
Quick to develope big systems, and using just PHP for the main functions.

Comment by Leandro Ardissone — September 20, 2005

Hi Leandro –

Thanks for the feedback. How did it compare to the other PHP frameworks in your eyes?

Cheers,

Dion

Comment by Dion Almaer — September 20, 2005

The new name of the Framework is XOAD (http://www.xoad.org)

Comment by Lyubomir Petrov — April 15, 2006

Leave a comment

You must be logged in to post a comment.