Fatal error: Class 'mikehaertl wkhtmlto PDF' not found

Asked

Viewed 256 times

1

I’m not very familiar with Composer and need to use the library phpwkhtmltopdf.

I use Windows 8.1. I did the installation by normal setup, and it seems that it is working normally:inserir a descrição da imagem aqui

I did the installation using the command

composer require mikehaertl/phpwkhtmltopdf

And in the code of my website, I called the library:

use mikehaertl\wkhtmlto\Pdf;

But there’s always a mistake:

Fatal error: Class 'mikehaertl\wkhtmlto\Pdf' not found in...

I think I need to call the Composer somehow in the code. But according to the library documentation and the Composer installation manual, this should work. What’s missing?

1 answer

2

I found out. I have to give the command composer require mikehaertl/phpwkhtmltopdf inside my project folder and add the line require '/vendor/autoload.php';before calling the class.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.