1. #1
    Sencha User jesse.dhillon's Avatar
    Join Date
    Nov 2008
    Location
    Berkeley, CA
    Posts
    20
    Vote Rating
    1
    jesse.dhillon is on a distinguished road

      0  

    Default [3.0] Thoughts about an Ext.Direct router for Symfony

    [3.0] Thoughts about an Ext.Direct router for Symfony


    This thread is about Ext.Direct and Symfony. If this is not the right place for this post, please direct me to a better forum.

    Since learning about the new Ext.Direct functionality I've been considering how to implement a router in Symfony. For anyone not familiar, as I understand it the requirements are thus:

    A request will come in as a serialized array of transaction objects. Each object will have a transaction id and will specify the controller and action to which this request is to be routed. It will also contain zero or more arguments to supply to that controller/action pair.

    A router will have to process these transactions by routing them to the actions which will act upon them, then taking any return values from those actions and returning them in a transaction response object which has the id of the transaction to which the object is responding.


    So with that in mind I have been considering how best to implement a router in Symfony. So far I've thought that using factories.yml to override the controller class is the best way. The new controller class would have a dispatch() method that would detect somehow whether or not this is a request from Ext.Direct.

    I think a reasonable approach to signaling the server that the request is coming from Ext.Direct would be to set an HTTP header like so: 'X-Requested-With: Ext.Direct' or something to that effect.

    I haven't looked at 3.0 yet to see how this would be done but I assume that changing the prototype of some object somewhere would be enough to set a default header.

    Are there any Symfony users out there? Anyone have any thoughts about this? Thanks in advance.

  2. #2
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    [ moved to Open Discussion from 2.x Ux and Plugins ]

  3. #3
    Ext JS Premium Member smokeman's Avatar
    Join Date
    Jul 2007
    Posts
    475
    Vote Rating
    2
    smokeman is on a distinguished road

      0  

    Default


    looking at migrating to symphony from hand coded php, so I like the idea.
    does symphony work well with extjs app development?

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Not sure why the OP didn't indicate what Symfony is:
    www.symfony-project.org/

  5. #5
    Ext JS Premium Member dancablam's Avatar
    Join Date
    Apr 2008
    Location
    Dallas, TX
    Posts
    134
    Vote Rating
    0
    dancablam is on a distinguished road

      0  

    Default


    Hi Jesse,

    I'm working on a extjs router plugin for symfony and should have a beta version available in a couple weeks. If you would like to assist that would be excellent.

    I'm waiting on official router specs from the ext team which they mentioned they'd publish soon. Aside from that I am also trying to determine the best method to integrate the router with symfony so that it can integrate with existing applications and so the performance is acceptable.

    Since all ext router requests go to a single url (ie /myapp/mymodule/router) there should be no need to add an HTTP header to diferentiate a router request from another request. Instead you can simply put a reference to a "symfonized" router class in the appropriate action class.

    I'll keep you posted and if you (or any other ext+symfony devs) like to further collaborate with me on a symfony plugin please PM me and I'll send you my email address and skype id.

    Cheers,
    Dan

  6. #6
    Ext JS Premium Member dancablam's Avatar
    Join Date
    Apr 2008
    Location
    Dallas, TX
    Posts
    134
    Vote Rating
    0
    dancablam is on a distinguished road

      0  

    Default


    Here's the symfony plugin:

    http://www.extjs.com/forum/showthrea...854#post324854

    Cheers,
    Dan