Skip to content
Nette JSONP Response Extension
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
LICENSE
README.md
composer.json

README.md

nette-jsonp

Nette JSONP Response Extension

Installation

The recommended way to install Nette JSONP Extension is through Composer:

composer require residit/nette-jsonp

Usage

namespace App\Presenters;

use Nette,
  Residit\Application\Responses\JsonpResponse;

class BasePresenter extends Nette\Application\UI\Presenter {

  /**
   * 
   * @param string $callback 
   * @param string $query
   */
  public function actionExampleEndpoint($callback, $query) {
    // ...
    // do the magic with $query
    // ...
 
    $data = array('foo' => 'bar');

    $this->sendResponse(new JsonpResponse($callback, $data));

  }
}
You can’t perform that action at this time.