composer installation and usage
tete2soja opened this issue · comments
Hello,
I used composer
to install the package but I can't load and use the class in my PHP code. I didn't find any example to use it with composer.
Can you give the correct use
to use or class name. I tried with this ones:
require 'vendor/autoload.php';
use Detection\MobileDetect;
$mobileDetect = new MobileDetect();
use Detection\MobileDetect;
$mobileDetect = new MobileDetect;
use MobileDetect\MobileDetect;
$mobileDetect = new MobileDetect;
use MobileDetect\MobileDetect;
$mobileDetect = new MobileDetect();
And always get this error: Fatal error: Uncaught Error: Class 'Mobile_Detect' not found in /var/www/html/header.php:17 Stack trace: #0 /var/www/html/index.php(1): require_once() #1 {main} thrown in /var/www/html/header.php on line 17
Thanks in advance!
Solve on my own.
use Detection\MobileDetect;
$detect = new Mobile_Detect();