Hello folks,
I have a class called CurrencyConversor.php located at /app/library/classes/, and i'm trying to use Universal Class Loader functionality from Phalcon to use it into my controllers. Here is what I'm trying:
index.php
//Register an autoloader
$loader = new \Phalcon\Loader();
//...other stuff...
$loader->registerClasses([
'CurrencyConversor' => 'library/classes/CurrencyConversor.php'
]);
$loader->register();
//...
SomeController.php
public function doAction()
{
$cc = new CurrencyConversor();
}
And this is what I get when i load the controller:
Fatal error: Class 'CurrencyConversor' not found in C:\the\path\to\phalcon_app\app\controllers\SomeController.php on line 63
What am I doing wrong? Isn't it the right way to implement a Universal Class?