We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

No such file or directory when including Snappy PDF

I'm trying to include the autoloader, but i'm getting the PHP error no such file or directory even though PHPstorm and the path is correct?

How do i register Snappy in Phalcon to be able to call the PDF generator functions?

Snappy github link: https://github.com/KnpLabs/snappy

Link to the MVC structure. https://imgur.com/UffelTv

Im pretty sure that has to do with your realtive path. Try using the full OS path. But more correctly, use realpath( '../../common/plugins/....../autoload.php')

Make a define of that since it looks as you need it later as well

Regards



6.4k
Accepted
answer

Registered the namespace and the autoloader did the rest of the job :-)

Got it working with following:

$loader->registerNamespaces(array( 'Knp\Snappy' => $config->application->CommonSnappy ))->register();