Hello. Phalcon seems to not be able to handle a dot in the URL when using the default routing behavior and when there is no controller specified in the URL. For example, when I try to load www.site.com/somecontroller/action.php, Phalcon throws a Not Found exception which is expected since there's no such controller, nor such action. However, when I enter www.site.com/action.php in the address bar, Phalcon erroneously loads the index action from the index controller instead of throwing a Not Found exception. Why is Phalcon behaving like this, and what can I do about it? I could adjust the htaccess file to not match dots in the URL, but that's not really a solution.
Here's my bootstrap file:
// Register the autoloader
$loader = new \Phalcon\Loader();
$loader->registerNamespaces([
'ControlPanel' => '../ControlPanel/'
])->register();
// Create a dependancy injection
$di = new \Phalcon\DI\FactoryDefault();
// Registering a dispatcher
$di->set('dispatcher', function () {
$dispatcher = new \Phalcon\Mvc\Dispatcher();
$dispatcher->setDefaultNamespace('ControlPanel\Controllers');
return $dispatcher;
});
// Registering the view component
$di->set('view', function () {
$view = new \Phalcon\Mvc\View\Simple();
$view->setViewsDir('../ControlPanel/Views/');
return $view;
});
$application = new \Phalcon\Mvc\Application($di);
// Since we are using Simple views, we must disable implicit views
$application->useImplicitView(FALSE);
echo $application->handle()->getContent();