src/Controller/DocsController.php
protected function jsonResponse($json)
    {
        $this->set('json', $json);
        $this->viewBuilder()->setLayout(false);
        $this->addCorsHeaders();
        $this->response = $this->response->withType('json');
    }
protected function jsonResponse($json)
    {
        $this->set('json', $json);
        $this->viewBuilder()->setLayout(false);
        $this->addCorsHeaders();
        $this->response = $this->response->withType('json');
    }
protected function jsonResponse ( $ json ) { $ this -> set ( 'json' , $ json ) ; $ this -> viewBuilder ( ) -> setLayout ( false ) ; $ this -> addCorsHeaders ( ) ; $ this -> response = $ this -> response -> withType ( 'json' ) ; }
Configures the json response before calling the index view.

@param string $json JSON encoded string
@return void
Configures the json response before calling the index view .