Accessing Config file data from main.volt template (layout)

Hi,

I'm trying to access an attribute in my phalcon config file.

For example in the config.ini I have got the following code:

[website] title = website_title

I would like to access title from main.volt in the views->layout please.

I have already added the config to the di using the following:

$config = new Phalcon\Config\Adapter\Ini(DIR . '/../app/config/config.ini'); $di = new \Phalcon\DI\FactoryDefault();

$di->set('config', $config);

I can access the config in the views easily and it does work as follwo:

{{ config.website.title }}

but when I use the same in the main.volt it doesn't get the value and it's just blank.

Would you please help?

Thanks a lot

Could you just clarify what view it does work in?

I can access the config in the views easily and it does work..