Esempio n. 1
0
 public static function jsonp($arr)
 {
     $callback = request\sanitize::request('callback', 'string');
     $output = static::json($arr);
     if ($callback) {
         header('Content-Type: text/javascript');
         return $callback . '(' . $output . ');';
     } else {
         header('Content-Type: application/x-json');
         return $output;
     }
 }
Esempio n. 2
0
 public static function isAjax()
 {
     return strtolower(request\sanitize::server('HTTP_X_REQUESTED_WITH', 'string')) == 'xmlhttprequest';
 }