Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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. http://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



2.6k
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();