| Joomla: | ![]() |
|
| Type: | ![]() |
|
| Download: | Download the Simple Mobile Detection plugin | |
| Version: | 1.1 | |
| License: | GNU/GPL 2.0 | |
| Please leave a review if you like this extension: http://extensions.joomla.org/extensions/mobile/mobile-display/21806 |
||
Description:The Simple Mobile Detection plugin does a simple check to see if the client is on a mobile device. If so, it stores this in the User State so that you can check anywhere in your code if you're dealing with a mobile client. The Mobile Detection plugin uses the default Joomla Browser class and extends it with detection for iPad, iPhone, iPod and Android devices. The Joomla iPad detection and iPhone or iPod detection will store on what device the client is currently viewing the website. The Joomla Android detection is a little more advanced and also attempts to collect more information about the device, like the model and the Android build. This example demonstrates how to do the check, and get the device parameters. //Get the switch from the User State if this is a mobile device $mobile = JApplication::getUserState('cmobile.ismobile', false); if($mobile){ //It's a mobile device, get the paramaters $device = new JRegistry(JApplication::getUserState('cmobile.device')); $deviceName = $device->get('name'); if($deviceName == 'ipad'){ //This is an iPad } if($deviceName == 'iphone'){ //This is an iPhone } if($deviceName == 'android'){ //This is an Android device //Get the model, if the plugin got it $model = $device->get('model', false); //Get the build, if the plugin got it $build = $device->get('build', false); } } |
||
|
Version log: |
1.1 31-10-2012: Support Joomla 3.0 01-03-2012: Release |
|