In app config:
'components'=>array(
...
'mobileDetect' => array(
'class' => 'application.vendors.candasm.yii1-mobile-detect-component.src.MobileDetectComponent'
),
...
);
$detect = Yii::app()->mobileDetect;
// call methods
$detect->isMobile();
$detect->isTablet();
$detect->isIphone();
...
For more information visit MobileDetect Library.
#####Note: Don't forget to set vendor-dir in composer.json file for YiiFramework 1.1.x versions.
"config":{
"vendor-dir":"protected/vendor/"
},