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

1

I'm not very familiar with the composer and need to use the phpwkhtmltopdf library.

I use Windows 8.1. I installed it through normal setup, and it looks like it's working normally:

I installed using the

composer require mikehaertl/phpwkhtmltopdf

And, in my site code, I called the library:

use mikehaertl\wkhtmlto\Pdf;

However, it always gives the error:

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 is missing?

    
asked by anonymous 08.06.2015 / 14:55

1 answer

1

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

    
08.06.2015 / 15:16