below is fatal error : Fatal error: Declaration of forum\frontend\Module::registerAutoloaders() must be compatible with Phalcon\Mvc\ModuleDefinitionInterface::registerAutoloaders(Phalcon\DiInterface $dependencyInjector = NULL) in D:\xampp\htdocs\forum\apps\frontend\Module.php on line 9
pls help support on this and below is code for ../apps/frontend/Module.php,thanks.
namespace forum\backend;
use Phalcon\Mvc\ModuleDefinitionInterface; use Phalcon\Loader; use Phalcon\Mvc\Dispatcher; use Phalcon\Mvc\View;
class Module implements ModuleDefinitionInterface{ //注册自定义加载器 public function registerAutoloaders($di = NULL){ $loader = new Loader(); $loader->registerNamespaces(array( 'forum\backend\controllers' => '../apps/backend/controllers/', 'forum\backend\models' => '../apps/backend/models/' ) );
$loader->register();
}
//注册自定义服务
public function registerServices($di){
$di->set('dispatcher',function(){
$dispatcher = new Dispatcher();
$dispatcher->setDefaultNamespace('forum\backend\controllers');
return $dispatcher;
});
$di->set('view',function(){
$view = new View();
$view->setViewsDir('../apps/backend/views/');
return $view;
});
}
}