sfAmfPlugin - 0.9.2

This Plugin to handle AMF requests from Flex client frontends

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source



The sfAmfPlugin provides you with all you need to write symfony backends for Flex clients. The communication is done via Adobes AMF protocol. On serverside the SabreAMF library is used to encode/decode the AMF streams.


Please use the current version from the subversion repository (http://svn.symfony-project.com/plugins/sfAmfPlugin). Copy the checked out version to the plugins folder of your project and execute the command symfony cc.

That's it


AMF-Client Requests are try to execute Services on the backend. Therefore you have to create a RemoteObject in Flex that has a Symfony-URL (i.e http://flextest/Test/amf).

All your services you can call will need to be saved under lib/services in your project folder. There you can add as many subfolders as you need/want. Services on Flex-Side can use package names like org.company.project.Servicename. You can use this with symfony too. All you need to do is to save this Service under lib/services/org/company/project/Servicename.php. That’s it!

A service can look like this:

class TestService extends sfAmfService {
    public function getValues() {
        return array('value1', 'value2', 'value3');

Please keep in mind that your service needs to extend th sfAmfService class

But how is this service called from client side? We need an URL to do so. For symfony this means you need a module and an action. The following listing shows you how an AMF action should look like:

public function executeAmf() {

    $gateway = new sfAmfGateway();
    $response = sfContext::GetInstance()->getResponse();
    return sfView::NONE;

Future improvements

  • Support for Doctrine objects
  • Support for Propel objects
  • PEAR packaging so that you can install via the symfony installer
  • Annotations for the Service-Methods (i.e. authorization, Class binding and so on)
  • Configurable services folder


For the full copyright and license information, please view the LICENSE file that was distributed with this source code.