// public/index.php
define('BASE_DIR', dirname(__DIR__));
define('APP_DIR', BASE_DIR . '/app');
include APP_DIR . "/config/initialize.php";
$application = new \Phalcon\Mvc\Application($di);
$di['app'] = $application; // Important
//require_once("../app/library/snowair/phalcon-debugbar/src/ServiceProvider.php");
if ($config->get("application", "environnement") == "production") {
ini_set('display_errors', 'Off');
error_reporting(0);
}
else {
new \Whoops\WhoopsServiceProvider($di);
}
echo $application->handle()->getContent();
// app/config/service.php
$di = new Phalcon\DI\FactoryDefault();
$di->set('session', function() {
$session = new Phalcon\Session\Adapter\Files();
if (!isset($_SESSION)) {
$session->start();
}
return $session;
});
// app/controllers/ClassController.php
function updateAction()
{
Helpers\Famille::updateTaux();
}
// app/componets/helpers/Famille.php
abstract class Famille {
abstract static function updateTaux()
{
// $this is undefined
//How can I get the service Session
}
}
I want to call the service session into my class Famille . How can I get it ? Thanks !