isAjax() public static method

public static isAjax ( )
示例#1
0
 private static function getViewPostfix($responseType)
 {
     $availableViewsMap = array('text/xml' => '.xml.phtml', 'application/json' => '.json.phtml', 'text/json' => '.json.phtml');
     $viewForType = Arrays::getValue($availableViewsMap, $responseType, false);
     if ($viewForType) {
         return $viewForType;
     }
     return Uri::isAjax() ? '.ajax.phtml' : '.phtml';
 }
示例#2
0
 /**
  * @test
  */
 public function shouldReturnTrueWhenAjaxRequest()
 {
     //given
     $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
     //when
     $isAjax = Uri::isAjax();
     //then
     $this->assertTrue($isAjax);
 }
示例#3
0
 public function isAjax()
 {
     return Uri::isAjax();
 }
示例#4
0
 private function needPrettyHandler()
 {
     $isHtmlResponse = ResponseTypeResolve::resolve() == "text/html";
     return $isHtmlResponse && !Uri::isAjax();
 }