Search code examples
phpzend-frameworkbackbone.js

Is Zend framework with backbone.js good idea?


I am new to backbone.js and I would like to create my first medium scale website application with backbone.js. I used to create websites only with zend framework. My question is: Is zend framework to heavy to use with backbone.js, with that I mean if I should rather use some other rest frameworks for php (Slim)? Or in other words, what is a good server side framework/library to use with php?


Solution

  • We use zend framework and backbone.js and the integration works pretty well.

    Zend framework (ZF1) offers an abstract rest controller, which automatically handles GET/POST/DELETE/PUT requests. http://framework.zend.com/apidoc/1.9/Zend_Rest/Zend_Rest_Controller.html

    in our bootstrap, we set a module just for rest api controllers, called api. note your need to add a rest router for this module:

            $restRoute = new Zend_Rest_Route($frontController);
            $frontController->getRouter()->addRoute('oauth_route', $route, array('api')););
    

    any controller in this module extends Zend_Rest_Controller and implements getAction, indexAction, deleteAction and so on.

    PS. avoid Zend_Rest_Server & Zend_Rest_Client. these are old modules.