1. #1
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306
    Vote Rating
    0
    deanna is on a distinguished road

      0  

    Default Proposal: Zend_ExtJS classes

    Proposal: Zend_ExtJS classes


    I am starting to build a library of ExtJS interface classes that plug into the Zend Framework. I wanted to know if there was any interest in flesh this out more to a public extension. I have parts of this done and being used in a project, but it would be nice to have the rest - and if there is interest I will try to incorporate other ideas into it.

    A small intro to Zend Framework for those that don't use it. It is a MVC framework that uses URL rewrite rules to process a URL in the format of hostname://module(optional)/controller/action . Every controller is a php class in a file that has methods that are the actions. the controller actions validate the parameters interact with the model (which usually is tied to the database) and when it exits a view template by the same controller action name is processed to return the request.

    I have subclassed the Controller to Zend_ExtJS_Controller_Action. In its constructor it adds an ajax context switch, if it is an xhr request it looks for a format parameter. I used the extraParams in my code to default that to json format.
    PHP Code:
    Ext.Ajax.extraParams = { format'json' }; 
    If the format is html it looks for a view with controller/action.ajax.phtml for the template to send back. If someone uses the browser to navigate the module/controller/action the page will return a 403 error. But the developer can set ExtJS in debug mode and add on the URL line extjs-mode=dump and it will give an object dump of all the data it is returning. Or (this I want to add) if extjs-mode=test, it will create a page with a viewport and try to instantiate any components in the data. I also want to add an allow browser setting in the code so that it won't automatically throw a 403 error but do the normal view processing.

    I have added lots of view helper routines. Inside the action you call one of them like
    PHP Code:
    $this->view->send_success(); 
    Some of the helpers I have are
    send_success(optional data);
    send_failure(optional message);
    send_form(name, Zend_ExtJS_Form object); sends back a config object with xtypes
    send_form_errors(either Zend_ExtJS_Form object or array of associated errors, data array of associated data);
    send_store(Zend_ExtJS_Store);
    send_component(name, ExtJS_Component decedent);sends back a config object with xtypes

    This will require supporting classes of
    Zend_ExtJS_Form (and form elements)
    Zend_Component generic component
    Zend_Panel
    Zend_Window
    Zend_Grid

    Plus Zend_ExtJS_Store that creates a store from either a fetchall or user created array

    Also Zend_ExtJS_Handler so that an component can have js code associate with it

    When you send a form or component it will create a component array associated by the passed name plus a map of handlers. There will be a js script piece on the recieving end to

    getZendComponent(name) returns the created component with the handlers eval'ed
    getZendComponentConfig(name) returns the config object for the component with handlers eval'ed

    So, also, for the non-ajax pages. Zend_ExtJS will help build the script and css link sections for you. You tell it your local path to extjs and it will create the rest of the path, switching between debug or minified based on the previously stated debug mode. You can also tell it any personal js code to link in.

    If anyone else is interested in something like this, lets work out a common framework that we can all share. No timeline on when this will be ready. But we could do a google share on the code when it gets somewhat ready.

    Thoughts? Ideas? Interest?

  2. #2
    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


    There's other frameworks that use url rewriting to route requests to controller/method, for example CodeIgniter. As you deliberate, maybe rather than call everything Zend_whatever, you go a bit more agnostic and maybe keep it abstract enough to work with any URF (Url Rewrite Framework... )

    P.S. With php6 on the horizon, maybe all the Zend_whatever, won't require all the Zend_ if it was introduced for namespace issues?

  3. #3
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306
    Vote Rating
    0
    deanna is on a distinguished road

      0  

    Default


    Quote Originally Posted by mjlecomte View Post
    There's other frameworks that use url rewriting to route requests to controller/method, for example CodeIgniter. As you deliberate, maybe rather than call everything Zend_whatever, you go a bit more agnostic and maybe keep it abstract enough to work with any URF (Url Rewrite Framework... )
    Generally I would like to do that. But at least with zend, which is what I'm working with, it really needs to plug into their architecture which means using their classes. I don't want to rewrite a whole controller or view template, just create the helpers for the existing one - that is an order or two of magnitude difference.

  4. #4
    Sencha User aityahia's Avatar
    Join Date
    Feb 2009
    Posts
    82
    Vote Rating
    0
    aityahia is on a distinguished road

      0  

    Default


    hi all
    it is very good initiative, II currently develop a project with Zend FrameWork and a ExtJS for views,I support highly such a project and I follow ready to test and help if necessary.

  5. #5
    Ext User
    Join Date
    Apr 2008
    Location
    Cape Coral, FL
    Posts
    9
    Vote Rating
    0
    ZeroPain is on a distinguished road

      0  

    Default


    I use Zend Framework and ExtJS for most my projects of decent size anyways. If you need anyone to test i can Maybe able to help ya add a feature or bug fix here and there too. Just my schedule is kinda crazy right now so can't commit to more then help testing.

    I have actually been thinking about doing the same myself after seeing dojo and jquery support in Zend. Just haven't been able to find the time. But like i said more then willing to help test and anything else i can find the time for at least probably submit a couple bug fixes if i find any bugs and patches if i need to add a feature for something i'll be more then willing to share it with your code base.

  6. #6
    Developer... jon.whitcraft's Avatar
    Join Date
    Mar 2007
    Posts
    391
    Vote Rating
    0
    jon.whitcraft is on a distinguished road

      0  

    Default


    Deanna,

    I work closely with the Zend Framework Team so let me know any way I could help you with the proccess.

    Have you created a proposal for the Zend_Extjs?

    I also know this would be like the jquery one and fall under the ZendX_ layout as it would not be supported a part of the core library.

    Jon
    Jon
    Lead Internal Application Engineer - SugarCRM
    h2ik.co

  7. #7
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306
    Vote Rating
    0
    deanna is on a distinguished road

      0  

    Default


    I am working on a proposal. I posted in the zf mailing list to get feedback on my approach and Matthew responded. So now making the changes he suggested in the approach - actually very minor overall. I have sent a licensing question to extjs to make sure there will be no conflicts there. The proposal doesn't generate extjs code, only config blocks so I don't think it will be a problem. Being in the ZendX is not a problem, as long as it exists to help people that want it.

  8. #8
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306
    Vote Rating
    0
    deanna is on a distinguished road

      0  

    Default


    How long does it usually take questions to be answered from licensing@extjs.com? I have had a question sent about this project without a response or acknowledgment that it is being looked at. Even sent a follow up email. I am curious to the status, with no acknowledgment I am not sure it ever got received.

  9. #9
    Ext User
    Join Date
    Oct 2007
    Posts
    160
    Vote Rating
    0
    leandrorc is on a distinguished road

      0  

    Default


    Good initiative! I was trying to begin something like that. But i don't understant whom will generate the extjs code, if not the classes? Will we continue writing "Ext.Window" in the templates files?

    I think the license terms could be more simpler, if they aren't. What i understand is: if you use extjs to develop closed source applications, you must purchase a license, right? So, what is the problem in the zend framework have native classes for extjs components? Or even, if someone create a zend framework extension, what is the problem in it generating extjs code? Is extjs license restrictive that way?

  10. #10
    Ext User deanna's Avatar
    Join Date
    Aug 2007
    Location
    Alabama
    Posts
    306
    Vote Rating
    0
    deanna is on a distinguished road

      0  

    Default


    Hey

    The proposal is not for the ZendX_ExtJS module to generate code, but config blocks with xtypes. Components can be generated directly from them. This creates more efficiency javascript because it will use lazy instantiation for the components. There will be handlers where the user can add in code for things, this is not generated by the by the ZendX_ExtJS module. I have signed the CLA with zend, waiting on it to be processed so I can create the proposal. I have some of the code written, but still need guidance from the zend guys on whether an extjs form (which is sent back by ajax) is also required to display normally if not sent back. This brings up some issues if it does because there are extjs elements (grid for example) that is not in pure html. When I use Form, I mean from a zend perspective. From the extjs perspective we are sending back components.

    For example: a return might be something like

    PHP Code:
    {
    "success":true,
    "login-form":{
    "xtype""form",
    "id":"loginPanel",
    "height":"auto",
    "width":"auto",
    "bodyStyle":"margin:5px;",
    "monitorValid":true,
    "defaults":{
         
    "validationEvent":"blur",
         
    "allowBlank":false,
         
    "selectOnFocus":true,
         
    "msgTarget":"side",
         
    "labelStyle":"font-weight:bold;"
    }
    "labelWidth":80,
    "labelAlign":"left",
    "items":[
         {
         
    "xtype":"textfield",
         
    "id":"username-fld",
         
    "fieldLabel":"Username",
         
    "name":"username",
         
    "emptyText":"User ID Required",
         
    "autoCreate":{"autocomplete":"on","tag":"input","type":"text","size":"20"},
         
    "tabIndex":1
         
    },{
         
    "xtype":"textfield",
         
    "inputType":"password",
         
    "fieldLabel":"Password",
         
    "name":"password",
         
    "tabIndex":2
         
    },{
    ... 

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar