I add a routing rule below in index.php
$router->add("/MyController/{partner:[a-zA-Z0-9]{3}}", ['controller' => 'MyController', 'action' => 'handler'])
->convert('partner', function($partner) {
return 'Android_' . $partner;
});
MyController->handlerAction
public function handlerAction()
{
$partner = $this->dispatcher->getParam('partner');
if (class_exists($partner)) {
$p = new $partner();
$p->process();
} else {
echo "Class {$partner} Not Found.";
}
}
and I put Android_XXX classes into application/library, but I got Class Android_XXX Not Found, any idea? library folder already register via \Phalcon\Loader.
Thanks.
Using registerPrefixes, the class can be found now.