Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a Fatal Error #19

Closed
joseym opened this issue Sep 14, 2011 · 4 comments
Closed

Getting a Fatal Error #19

joseym opened this issue Sep 14, 2011 · 4 comments

Comments

@joseym
Copy link

joseym commented Sep 14, 2011

Fatal error: Class 'Knp\Snappy\Pdf' not found in /Users/joseym/Sites/tests/pdf/index.php on line 6

@stof
Copy link

stof commented Sep 14, 2011

Are you registering an autoloader for the library ?

@joseym
Copy link
Author

joseym commented Sep 14, 2011

No, does the library not work out of the box?

@stof
Copy link

stof commented Sep 14, 2011

As for any other PHP code, you have to tell PHP how to find the classes. The old way to do this is to use require_once everywhere in the code. The modern way is to use the autoloading. But you need to register an autoloader for the classes.
Snappy follows the PSR-0 convention so it can be autoloaded by any compliant autoloader (Symfony2 and Doctrine Common provide such autoloaders, and probably Zend as well)

@joseym
Copy link
Author

joseym commented Sep 14, 2011

Awesome. Yeah. I'm new to php 5.3 conventions. Thanks, I'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants