1. #1
    Sencha User
    Join Date
    May 2011
    Location
    Marseille, France
    Posts
    7
    Vote Rating
    0
    kimimsc is on a distinguished road

      0  

    Default Answered: ExtJS 4 + ZendFramework

    Answered: ExtJS 4 + ZendFramework


    Hi,
    I am trying to load a store dynamically using Zend.

    Currently i have this ext code:
    Code:
    ....
    proxy: {
            type: 'ajax',
            url: '',
            reader: {
                type: 'json',
                root: 'test',
                successProperty: 'success'
            }
        }
    ....
    and this php code:
    PHP Code:
    /*path to this controller: application/controllers/TestController.php*/
    <?php

    class TestController extends Zend_Controller_Action
    {

        public function 
    init()
        {
            
    /* Initialize action controller here */
        
    }

        public function 
    testAction()
        {
            
    $data = array(/*data*/);
            echo 
    "{
                success: true,
                test: " 
    json_encode($data) . "
            }"
    ;
        }


    }
    I would like to know what to put in the proxy url to call the testAction function.

    Thanks

  2. For codeigniter the url is like :
    Code:
        url: BASE_URL + 'controller/method',
    where in codeigniter view:
    Code:
                var URL = '<?php echo base_url(); ?>',
                	BASE_URL =  URL + 'index.php/';
    But for zend, could be sth similar, in any case, here a nice link: http://www.slideshare.net/ThorstenSu...c-driven-extjs

  3. #2
    Sencha - Senior Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,042
    Vote Rating
    992
    Answers
    3631
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Do you have a url to hit that action in Zend?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    May 2011
    Location
    Marseille, France
    Posts
    7
    Vote Rating
    0
    kimimsc is on a distinguished road

      0  

    Default


    Actually that's what i want to know.

    During an internship i was working with ext 3 and zend, and they were doing something like :

    Code:
    url: 'test1_test2/test3'
    if the they had a project structured like this:
    project->
    application->
    controllers->
    test1->
    test2Controller.php and (public function test3Action() {})
    ...
    ...
    ...
    ...

  5. #4
    Sencha - Senior Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,042
    Vote Rating
    992
    Answers
    3631
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This might be a question for the Zend community then.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    655
    Vote Rating
    38
    Answers
    21
    vadimv has a spectacular aura about vadimv has a spectacular aura about

      0  

    Default


    For codeigniter the url is like :
    Code:
        url: BASE_URL + 'controller/method',
    where in codeigniter view:
    Code:
                var URL = '<?php echo base_url(); ?>',
                	BASE_URL =  URL + 'index.php/';
    But for zend, could be sth similar, in any case, here a nice link: http://www.slideshare.net/ThorstenSu...c-driven-extjs

  7. #6
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    tomtom__ is on a distinguished road

      0  

    Default


    normally a std. ZF-Project without reconfigured Router works like that:

    http://yourdomain.tld/_package_/_controller_/_action_
    in your case I bet it's:
    http://yourdomain.tld/default/test/test

    and please, make use of Zend_Json.

  8. #7
    Sencha User
    Join Date
    May 2011
    Location
    Marseille, France
    Posts
    7
    Vote Rating
    0
    kimimsc is on a distinguished road

      0  

    Default


    Actually apache wasn't correctly configured and that's why i couldn't call any method.

    Anyway, thanks for your help.