Created
August 17, 2012 09:47
-
-
Save notomato/3377510 to your computer and use it in GitHub Desktop.
Custom detector/detect iphone requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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