In an extension I generate javascript variables.
How can I add the code with ResourceLoader? I only see addModules(), but there are no js files, I generate the code.
In an extension I generate javascript variables.
How can I add the code with ResourceLoader? I only see addModules(), but there are no js files, I generate the code.
You can add these with the hooks MakeGlobalVariablesScript and ResourceLoaderGetConfigVars.
Those are both more global. For more page contextual state, you would use the addJsConfigVars() function. See also Manual:OutputPage.php#JavaScript_and_CSS