public function render(Subject $subject)
    {
        $controller = $this->_controller();
        $controller->viewBuilder()->setClassName('CrudJsonApi.JsonApi');

        // render a JSON API response with resource(s) if data is found
        if (isset($subject->entity) || isset($subject->entities)) {
            return $this->_renderWithResources($subject);
        }

        return $this->_renderWithoutResources();
    }
public function render(Subject $subject)
    {
        $controller = $this->_controller();
        $controller->viewBuilder()->setClassName('CrudJsonApi.JsonApi');

        // render a JSON API response with resource(s) if data is found
        if (isset($subject->entity) || isset($subject->entities)) {
            return $this->_renderWithResources($subject);
        }

        return $this->_renderWithoutResources();
    }
public function render ( Subject $ subject ) { $ controller = $ this -> _controller ( ) ; $ controller -> viewBuilder ( ) -> setClassName ( 'CrudJsonApi.JsonApi' ) ; // render a JSON API response with resource(s) if data is found if ( isset ( $ subject -> entity ) || isset ( $ subject -> entities ) ) { return $ this -> _renderWithResources ( $ subject ) ; } return $ this -> _renderWithoutResources ( ) ; }
Set required viewVars before rendering the JsonApiView.

@param \Crud\Event\Subject $subject Subject
@return \Cake\Http\Response
Set required viewVars before rendering the JsonApiView .