This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I have settings in the backend with an array. eg: return array(
'foo' => 'bar'
);
I can't seem to get hold of these in the theme frontend. Im doing this but get an error: use Config; function onStart() {
$this['foo'] = Config::get('my.plugin::foo');
}
What am i doing wrong? is it the name space etc?
I get an error of array to string conversion. When I check the log files its returning an empty array, despite the key existing in the config file. In the config file. plugins/config/config.php return array('foo'=>'bar');
In the TWIG theme file, im simply: $this['foo'] = Config::get('my.plugin::foo');
{{ foo }}
registration2258 said:
I get an error of array to string conversion. When I check the log files its returning an empty array, despite the key existing in the config file. In the config file. plugins/config/config.php return array('foo'=>'bar');
In the TWIG theme file, im simply: $this['foo'] = Config::get('my.plugin::foo');
{{ foo }}
use Config; to component
Its probably due to a configuration settings issue. I don't have any problem duplicating and getting the value.
1-7 of 7