I want to add PHPMailer to my phalcon-project. I put PHPMailer-dir to library-dir. How a can create object PHPMailer without "require" with full path to file?
If PHPMailer is PSR-0 compliant you can use a namespaces/directories strategy, or map the class name directly to its path:
<?php $loader = new \Phalcon\Loader(); $loader->registerClasses( array( "PHPMailer" => "library/PHPMailer/PHPMailer.php", ) ); // register autoloader $loader->register();
https://docs.phalcon.io/en/latest/reference/loader.html#registering-classes
... and if not, you still add it as suggested and map all underlying classes as well :-) Easy as a pie.
And you leave a note to the author of the library to (finally) make his library PSR-0 compliant.