Get package config in theme

Permalink
Hi!

I hope someone can point me to the right direction...

I set in my package (handle: "chat") controller 2 values to config like this in install method:
$pkg = parent::install();
$pkg->getConfig()->save('front_end.show_chat', "yes");
$pkg->getConfig()->save('front_end.chat_script', "bla");


How can I reach this parameter in my theme?
$pkg = \Package::getByHandle('chat');
$script = $pkg->getConfig()->get('front_end.chat_script');
echo $script;
$check = \Config::get('chat::front_end.chat_script');
echo $check;

From both options above I get no output.

Thanks for your help
Marcus

 
shahroq replied on at Permalink Best Answer Reply
shahroq
The first code you write for obtaining the value seems correct and it should return the config value. If it doesn't, check your database Config table and see if you set the values correctly. In your case, the record should be like this:
configNamespace: chat
configGroup: front_end
configItem: chat_script
configValue: blah

I guess your "configNamespace" haven't set correctly.
marcusm replied on at Permalink Reply
Namespace was set correctly but the values not.

Thank you very much.