Skip to content

Instantly share code, notes, and snippets.

@notomato
Created August 17, 2012 09:47
Show Gist options
  • Select an option

  • Save notomato/3377510 to your computer and use it in GitHub Desktop.

Select an option

Save notomato/3377510 to your computer and use it in GitHub Desktop.
Custom detector/detect iphone requests
<?php
$request->detect('iPhone', array('HTTP_USER_AGENT', '/iPhone/'));
$isiPhone = $request->is('iPhone');
$request->detect('custom', function($request) {
if ($value = $request->env("HTTP_WHATEVER")) {
// Do something with $value
}
return false;
});
// http://www.slideshare.net/nateabele/the-zen-of-lithium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment