original_string: public function json($data, $jsonp = false)
      {
          $options = 0;
          defined('JSON_UNESCAPED_UNICODE') && $options = JSON_UNESCAPED_UNICODE;
          $content = json_encode($data, $options);
  
          if ($jsonp && preg_match('/^[$A-Z_][0-9A-Z_$.]*$/i', $this->request['callback']) === 1) {
              $this->setHeader('Content-Type', 'application/javascript');
              $content = $this->request['callback'] . '(' . $content . ')';
          } else {
              $this->setHeader('Content-Type', 'application/json');
          }
  
          return $this->setContent($content);
      }
code: public function json($data, $jsonp = false)
      {
          $options = 0;
          defined('JSON_UNESCAPED_UNICODE') && $options = JSON_UNESCAPED_UNICODE;
          $content = json_encode($data, $options);
  
          if ($jsonp && preg_match('/^[$A-Z_][0-9A-Z_$.]*$/i', $this->request['callback']) === 1) {
              $this->setHeader('Content-Type', 'application/javascript');
              $content = $this->request['callback'] . '(' . $content . ')';
          } else {
              $this->setHeader('Content-Type', 'application/json');
          }
  
          return $this->setContent($content);
      }
code_tokens: public function json ( $ data , $ jsonp = false ) { $ options = 0 ; defined ( 'JSON_UNESCAPED_UNICODE' ) && $ options = JSON_UNESCAPED_UNICODE ; $ content = json_encode ( $ data , $ options ) ; if ( $ jsonp && preg_match ( '/^[$A-Z_][0-9A-Z_$.]*$/i' , $ this -> request [ 'callback' ] ) === 1 ) { $ this -> setHeader ( 'Content-Type' , 'application/javascript' ) ; $ content = $ this -> request [ 'callback' ] . '(' . $ content . ')' ; } else { $ this -> setHeader ( 'Content-Type' , 'application/json' ) ; } return $ this -> setContent ( $ content ) ; }
docstring: Response JSON or JSONP format string
  
  @param mixed $data The variable to be convert to JSON string
  @param bool $jsonp Whether allow response json format on demand
  @return $this
docstring_tokens: Response JSON or JSONP format string