I am new to using Composer in Codeigniter and have read all I can to try and fix my issue, but are coming up short. The autoloader seems to to be autoloading? So here is where I am stuck:
composer require pdf/mpdf
composer_autoload
value to
$config['composer_autoload'] = FCPATH . "/vendor/autoload.php";
Then I created a simple function in my default controller like this:
function m_pdf() {
$mpdf = new mPDF();
$mpdf->WriteHTML('Hello World');
$mpdf->Output();
}
But when I run it, I get an error: Message: Class 'mPDF' not found
I have tried moving everything to the application folder, and change the value in the config file to TRUE, I have tried calling the autoloader from the function itself, but no luck.
I feel I am missing something obvious. Maybe some dependencies. As I said, I am new to use the composer. There were some suggestions on the web about running php composer.phar
but I get an error when I try and run that. Could that be it?
1) in namespace => use correct Mpdf class
If still not help => composer dump-autoload
(reconfigure your composer classMap)
If dump-autoload not help =>
vendor
directorycomposer install