Hi, I’m looking how to test if a c::set exists before calling c::get.
Context: I want to set a noindex variable on certain domains via the config.php file, each domain have its own config.php, some have the noindex variable, some have a variable set on false and some have nothing.
No matter what, I can’t make it work. When I get rid of the “not a function” error by setting a default value, the if test is always successful, whatever the variable content or its existence.
The way you use it, you get the option from the config, but if it is not set, you set false as the default value. So you would have to check if c::get is set:
if(c::get('globalconfignoindex') ) {
///
}
will return false if the value is not set or set to false