public function arrayToJson($content = null)
    {
        if ($this->getJsonEncodeArray() && is_array($content)) {
            $this->header('Content-Type: application/json');
            return json_encode($content);
        }

        return $content;
    }
public function arrayToJson($content = null)
    {
        if ($this->getJsonEncodeArray() && is_array($content)) {
            $this->header('Content-Type: application/json');
            return json_encode($content);
        }

        return $content;
    }
public function arrayToJson ( $ content = null ) { if ( $ this -> getJsonEncodeArray ( ) && is_array ( $ content ) ) { $ this -> header ( 'Content-Type: application/json' ) ; return json_encode ( $ content ) ; } return $ content ; }
Encode array to json if configured

@param $content

@return string
Encode array to json if configured