background preloader

Amf

Facebook Twitter

Amfphp

Objects iteration - symfony developers. Flex and PHP: remoting with Zend AMF : Mihai CORLAN. The latest PHP library to add support for AMF and remoting is Zend Framework. The preview prelease version 1.7 offers a new component Zend_AMF that lets you create Flex applications that talk to PHP backends using remoting. Since I am a big fan of remoting as a way to get data to your Flex/AIR clients, I wanted to add a short post explaining how to use it. Here is another post I wrote on remoting with AMFPHP. Actually this post is a part of a larger article I did for Adobe Developer Connection. You can download a Flex Builder project that contains the code I explain in this article from here. Installing the Zend Framework After downloading the Zend Framework 1.7 archive, extract the files. Next, save the file and restart your web server. What is AMF and remoting and why should you use it?

If you already know these answers, you may want to skip to the next section. As I noted earlier, Zend AMF remoting uses AMF to serialize messages between the server and Flex client. Create the PHP code. Zend_Amf with full Zend Framework at Space of Flex/AIR technolog. There are many examples on the web how to use Zend_Amf as a standalone component but couldn’t find one that actually shows how you can run it with the rest of the Zend Framework. Main benefit of running it in a way I will demonstrate in this post is that requests to AMF service classes are automatically bootstrapped with configuration, database initialization and other Zend components. Here is how I use Zend_Amf with the full framework. First we have to setup whole environment as it is in ZendFrameworkQuickstart (there is also already preconfigured archive available there). It will give you above folders structure; don’t forget about .htaccess file (as described in the quickstart tutorial)!!!

Now we will add Zend_Config to have a proper place for our database configuration. To do so we can create new config folder under application directory and place there an app.ini file. Once you have ini file in place we can now enter bootstrap.php to initialize Zend_Config. Zend_AMF Collection.