| 1 | <?php |
||
| 20 | trait DetectorTrait |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var string class of mobile detect use to detect device type. |
||
| 24 | * @see [[getDetector()]] |
||
| 25 | */ |
||
| 26 | public $detectorClass = MobileDetect::class; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var MobileDetect |
||
| 30 | */ |
||
| 31 | private $_detector; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Mobile detector |
||
| 35 | * |
||
| 36 | * @param bool $force weather you need to force the detector |
||
| 37 | * @return object|MobileDetect |
||
| 38 | * @throws \yii\base\InvalidConfigException |
||
| 39 | */ |
||
| 40 | 8 | protected function getDetector(bool $force = false): MobileDetect |
|
| 50 | } |
||
| 51 |