PHP code example of candasm / yii1-mobile-detect-component

1. Go to this page and download the library: Download candasm/yii1-mobile-detect-component library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

candasm / yii1-mobile-detect-component example snippets


'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();
  ...