Hi,
I have an ini file:
[database]
host = localhost
username = test
password = ****
dbname = test
In index.php i have:
use Phalcon\Config\Adapter\Ini as IniConfig;
$di = new FactoryDefault();
$di->set('config', function () {
return new IniConfig("config/config.ini");
});
// Set up the database service
$di->set('db', function () {
return new PdoMysql(
array(
"host" => $this->config->database->host, // or $di->config->database->host,
"username" => $this->config->database->userName,
"password" => $this->config->database->password,
"dbname" => $this->config->database->dbName
)
);
});
When I try to open the connexion it doesnt work, i have an error on all " $this->config->database->....":
<b>Notice</b>: Undefined property: Phalcon\Di\FactoryDefault::$config
Can you help me?