public function render($view = null, $layout = null)
    {
        if ($this->hasRendered) {
            return null;
        }

        $this->layout = "RestApi.{$this->_responseLayout}";

        $this->Blocks->set('content', $this->renderLayout('', $this->layout));

        $this->hasRendered = true;

        return $this->Blocks->get('content');
    }
public function render($view = null, $layout = null)
    {
        if ($this->hasRendered) {
            return null;
        }

        $this->layout = "RestApi.{$this->_responseLayout}";

        $this->Blocks->set('content', $this->renderLayout('', $this->layout));

        $this->hasRendered = true;

        return $this->Blocks->get('content');
    }
public function render ( $ view = null , $ layout = null ) { if ( $ this -> hasRendered ) { return null ; } $ this -> layout = "RestApi.{$this->_responseLayout}" ; $ this -> Blocks -> set ( 'content' , $ this -> renderLayout ( '' , $ this -> layout ) ) ; $ this -> hasRendered = true ; return $ this -> Blocks -> get ( 'content' ) ; }
Renders api response

@param string|null $view Name of view file to use
@param string|null $layout Layout to use.
@return string|null Rendered content or null if content already rendered and returned earlier.
@throws Exception If there is an error in the view.
Renders api response