getAcceptableContentTypes() public static method

Gets a list of content types acceptable by the client browser.
public static getAcceptableContentTypes ( ) : array
return array List of content types in preferable order
 public static function wantsHtml()
 {
     $acceptable = \Request::getAcceptableContentTypes();
     return isset($acceptable[0]) && $acceptable[0] == 'text/html';
 }
Example #2
0
 protected function isAcceptedJson()
 {
     return in_array('application/json', \Request::getAcceptableContentTypes());
 }