Jump to content

Recommended Posts

Posted

Hi, in the /site/init.php file I've stated:

wireSetting([
  'a_key' => [
    'value1', 'value2', 'valueN'
  ],
  '...' => '...'
])

I normally use with success the wireSetting in my template files like this: wireSetting('a_key').

I would like to use this wireSetting in an Hanna code, but when I do this I get the error "Method ProcessWire::wireSetting does not exist or is not callable in this context".

How can I use wireSetting in Hanna code?

 

Posted

Solution found using \ProcessWire\ namespace:

\ProcessWire\wireSetting('a_key')

Maybe there is something better...

Posted
1 hour ago, zoeck said:

You are probably missing the processwire namespace in the php file ?

I tried to state the namespace ProcessWire at the top of the Hanna code without success. I've to state the inline \ProcessWire\ namespace to make it work. ??‍♂️

It would be great if someone explains why this happens. ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...