In the etc/config.xml I can use some variables, like {{base_url}}, but I need to use other urls in this config.

How I can create custom variables to use in the etc/config.xml file?

Example:

In my config.xml I have this:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <payment>
        <pagseguro>
            <application_authorization_redirect>{{base_url}}pagseguro/application/authorization</application_authorization_redirect>
            <after_authorization_redirect>http://frontendapp.com/pagseguro</after_authorization_redirect>
        </pagseguro>
    <payment>
</config>

In the "application_authorization_redirect" I used the variable {{base_url}} but in the "after_authorization_redirect" I hardcoded the url, but I what to use here a dynamic url too. Something like:

<after_authorization_redirect>{{frontendapp_url}}pagseguro</after_authorization_redirect>
  • Actually, your question is not clear to me. Could you give an example? – Khoa TruongDinh Dec 7 at 3:40
  • @KhoaTruongDinh Thanks for the reply. I edited my post with an example. – Douglas Ianitsky Dec 13 at 13:13

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.