My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
PageName  
Basic demonstration of Sajax 0.14 for PHP
Updated Apr 20, 2009 by kristian...@gmail.com

Introduction

This is a very basic demonstration of Sajax 0.14 for PHP.

Example

<?php
	include_once("Sajax.php");

	class Services
	{
		public function SajaxGetString()
		{
			return "Hello World";
		}
		
		public function SajaxGetNumber()
		{
			return 42;
		}
	}
	Sajax::Sajax()->EnableDebug(true);
	Sajax::Sajax()->Export(new Services());
	Sajax::Sajax()->HandleRequest();
?>
<html>
	<head>
		<title>Test</title>
<?php
	Sajax::Sajax()->ExportIncludeJS();
?> 
	</head>
	<body>
		<form>
			<input type="button" value="Get String" onclick="sajax.Services.GetString(function(s) { alert(s); })"/>
			<input type="button" value="Get Number" onclick="sajax.Services.GetNumber(function(s) { alert(s); })"/>
		</form>
	</body>
</html>

Sign in to add a comment
Powered by Google Project Hosting