Helpers::isAjax PHP Method

isAjax() public static method

public static isAjax ( )
    public static function isAjax()
    {
        return !empty($_SERVER['HTTP_X_REQUESTED_WITH']);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Renders blue screen.
  * @param  \Exception|\Throwable
  * @return void
  */
 public function render($exception)
 {
     if (Helpers::isAjax() && session_status() === PHP_SESSION_ACTIVE) {
         ob_start(function () {
         });
         $this->renderTemplate($exception, __DIR__ . '/assets/BlueScreen/content.phtml');
         $contentId = $_SERVER['HTTP_X_TRACY_AJAX'];
         $_SESSION['_tracy']['bluescreen'][$contentId] = ['content' => ob_get_clean(), 'dumps' => Dumper::fetchLiveData(), 'time' => time()];
     } else {
         $this->renderTemplate($exception, __DIR__ . '/assets/BlueScreen/page.phtml');
     }
 }
All Usage Examples Of Helpers::isAjax