I use CodeIgniter 3 and I need composer to install some libraries needed for my application, like 2FA token generation, crawler detector, elephant IO, etc.
To use these components I load them at the beginning of the controllers that need it and also in a general purpose helper that I have.
Example:
PHP Code:
<?php
require_once FCPATH . '/application/third_party/composer/vendor/autoload.php';
use Sinergi\BrowserDetector\Browser;
use Sinergi\BrowserDetector\Os;
class MyClass extends CI_Controller
Is this way of working correct or is there some easier and better way to work?