Threaded View

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    60
    Vote Rating
    0
    Answers
    7
    novadys-sbu is on a distinguished road

      0  

    Default Answered: Ok, so I'm a n00b. MVC and PHP backend problems

    Answered: Ok, so I'm a n00b. MVC and PHP backend problems


    Hello everyone,

    As usual there is probably a simple answer to my problems, but I've been going around in circles.
    Here goes :

    I have a view in ExtJs with a simple button. In the handler function, I would like to call a function from my PHP backend (DocumentController.php class).


    Now, I absolutely need to call a PHP function as I wish to download a document on the click of the button.
    So what do I need to do in my handler function to call an DocumentController object ? Or do I have to call a plain PHP 4 page ?

    Is there an equivalent to :
    PHP Code:
    DocumentController myController = new DocumentController();
    myController.downloadDocument(); 
    Thanks for your help

  2. The easiest and quickest way to return results to your ExtJS app is to make an AJAX request to a remotely-accessible url in your PHP app that is configured to return data in a format that ExtJS can make use of (e.g., JSON, XML, etc.).

    For downloading files, you'll probably want to simply open up a new window with a url to a page in your PHP app that can manage serving up the file with the appropriate headers, content type, etc.

Thread Participants: 1

Tags for this Thread