First download AMFPHP 1.9 and unzip into your root webfolder (for example http://localhost/amfphp).
2. Create your first service
Into the amfphp/services create a new folder "itutorials" where we will put our php classes.
Now, into this "itutorials" folder, create a new php file: hello.php:
- Code: Select all
<?php
/**
* First tutorial class
*/
class Hello
{
/**
* first simple method
* @returns a string saying 'Hello World!'
*/
function sayHello()
{
return "Hello World!";
}
}
?>
The javadoc style comments used in this class, both in the class declaration and in the method declaration, will be also visible in the amfphp browser.
Amfphp browser has changed, now built with flex2 and you can explore all your services using http://localhost/amfphp/browser.
This is a screen shot of my browser having "hello.php" service selected:

As you can see the browser will display both the class and method's javadoc comments. You can also test your classes methods just using the "call" button. If your method require some arguments you will see near the call button an input field for every method's argument.
3. And you are done! :)
