ThirdParty Libraries usage - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: ThirdParty Libraries usage (/showthread.php?tid=68435) |
ThirdParty Libraries usage - iamolo - 07-10-2017 Good day, I have been trying to use Symfony yaml library on my CodeIgniter4 based project , I have added the necessary dependencies using composer. The Sysmfony library is downloaded to ThirdParty/sysmfony. I have included the necessary Symfony\Component\Yaml\Parser namespace on my controller as the code snippet hereunder shows, however, when i run this code it results into an exception "Class 'Symfony\Component\Yaml\Parser' not found", could someone kindly guide me in the right direction , and show me how to integrate and successfully use third party libraries in CodeIgniter4. Thank you kindly. PHP Code: <?php RE: ThirdParty Libraries usage - kilishan - 07-10-2017 Being Symfony, I imagine it's all available through Composer, so just do it all through Composer. Don't worry about using the third party directory at all. So: 1. add it as a requirement to your composer.json 2. composer update to install it 3. load the class like any other autoloaded class: Code: $yaml = new Parser(); That should do it. |