This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

registration2258
registration2258

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?

registration2258
Daniel81
Daniel81

What's the error?

registration2258
registration2258

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 }}

uitlab
uitlab

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

GrCOTE7
GrCOTE7
{{ dump (foo) }} 

?

auzadventure
auzadventure

Its probably due to a configuration settings issue. I don't have any problem duplicating and getting the value.

1-7 of 7

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.