Results 1 to 2 of 2

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

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Oct 2012
    Vote Rating

    Default 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();
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts