One solution is to create a base controller:
class BaseController extends \Phalcon\Mvc\Controller
{
public function beforeExecuteRoute()
{
// Do your stuff here
}
}
Other controllers will extend the base one:
class UserController extends BaseController
{
// .... your code
}