CodeIgniter Forums
Did you integrate the 3rd party library from Composer correctly? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Did you integrate the 3rd party library from Composer correctly? (/showthread.php?tid=78021)



Did you integrate the 3rd party library from Composer correctly? - allaga - 11-20-2020

Good evening! Dear members of the forum, I write through a translator, I do not know English at all, I write from the distant Northern region of Yakutia. I ask you to understand and forgive me. In the harsh winter conditions, I'm trying to do programming.

I edited the required array value in the application / config directory in the config.php configuration file:


PHP Code:
$config['composer_autoload'] = TRUE

The vendor directory was created successfully. I downloaded the library through the Composer. I have a question if I called the library correctly:
PHP Code:
class Myclass extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
    }

    // --------------------------------------------------------------------

    public function codeigniter()
    {
        $client = new GuzzleHttp\Client();

        $api_url 'https://api.github.com/users/codeigniter4';

        $req $this->client->request('GET'$api_url);

        if ($req->getStatusCode() === 200)
        {
            echo $res->getBody();
        }
    }


Thank you for your answers, have a nice day)))