I am currently trying to access the mdl-config through AMD to initialize a table depending on the users' settings. I tried the core module core/config, but it only returns
How can I access the database / the full config with AMD?
Normally you would choose the specific config fields that are needed by the AMD module and pass them in as params when calling $PAGE->requires->js_call_amd('amd_module_name', 'init_function', $array_of_params);
Creating an AJAX webservice to retrieve arbitrary site config settings sounds like a potential security risk to me ...
Thank you for your response - I am only a part timer so my answer is late.
I tried using your approach wich worked, but it gave me an indexed array instead of an associative array, which gets confusing when using a few variables. In my case, this means 8 variables/settings and counting.
As of now, the webservice version is working as I already use webservices in my plugin. The settings I want to retrieve here are for my plugin only which means that there should be no security risk in returning unwanted/unauthorized config-settings.
+1 for Davo's answer, use PHP to prepare the data you need and pass to your module in the initialisation call. It doesn't sound like your use case needs the complexity of a web service.