We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Accessing Configuration Keys in a Dynamic Way?

Accepted answer
12
Views
6
Comments
edited Jan 18, 2018 9:20AM in Customer Portal 6 comments

Content

Hello everyone,

I've numerous config variables set in the Agent Desktop which go like

CUSTOM_CFG_SCRIPT_ABC_33
CUSTOM_CFG_SCRIPT_DEF_26
CUSTOM_CFG_SCRIPT_GHI_51
.
.
.
and so on...

To fetch the values of these keys, I know I can use something like this:

$variable = RNCPHP\Configuration::fetch(CUSTOM_CFG_SCRIPT_DEF_26);

But is there a way in which I can use a wildcard (*) in it? Something like this?

$variable = RNCPHP\Configuration::fetch(CUSTOM_CFG_SCRIPT_*_26); // btw this doesn't work
The above doesn't work and throws error. Anyway to come around this problem?

Version

CP3

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!