src/Listener/ApiListener.php
public function viewClass($type, $class = null)
    {
        if ($class === null) {
            return $this->getConfig('viewClasses.' . $type);
        }

        return $this->setConfig('viewClasses.' . $type, $class);
    }
public function viewClass($type, $class = null)
    {
        if ($class === null) {
            return $this->getConfig('viewClasses.' . $type);
        }

        return $this->setConfig('viewClasses.' . $type, $class);
    }
public function viewClass ( $ type , $ class = null ) { if ( $ class === null ) { return $ this -> getConfig ( 'viewClasses.' . $ type ) ; } return $ this -> setConfig ( 'viewClasses.' . $ type , $ class ) ; }
Get or set a viewClass

`$type` could be `json`, `xml` or any other valid type
defined by the `RequestHandler`

`$class` could be any View class capable of handling
the response format for the `$type`. Normal
CakePHP plugin "dot" notation is supported

@param string $type Type
@param string|null $class Class name
@return mixed
Get or set a viewClass