for everyone that want see profiler in action:
if your project is multi module:
in your module.php
<?php
namespace Backend;
use Phalcon\Mvc\Dispatcher,
Phalcon\Mvc\View,
Phalcon\Mvc\ModuleDefinitionInterface,
Phalcon\Events\Manager as EventsManager;
class Module implements ModuleDefinitionInterface {
/**
* Register a specific autoloader for the module
*/
public function registerAutoloaders(\Phalcon\DiInterface $di = null) {
}
/**
* Register specific services for the module
*/
public function registerServices(\Phalcon\DiInterface $di) {
//Registering a dispatcher
$di->set('dispatcher', function () use ($di) {
$dispatcher = new Dispatcher();
$dispatcher->setDefaultNamespace("Backend\Controllers");
$eventsManager = new EventsManager; // log for profiler
$eventsManager->attach('dispatch:beforeDispatch', new \Common\Helpers\SecurityHelper()); // log for profiler
$dispatcher->setEventsManager($eventsManager); // log for profiler
return $dispatcher;
});
//Registering the view component
$di->set('view', function() {
$view = new View();
$view->setViewsDir(APP_PATH . 'app/backend/views/');
$view->setMainView('private');
$view->registerEngines(array('.volt' => 'voltService'));
return $view;
});
}
}