/** * Substitute placeholders {{placeholder_name}} with their values in XML string * * @param string $xmlString * @return string */ protected function _substitutePlaceholders($xmlString) { if ($this->subst === null) { $placeholders = ['baseUrl' => $this->scope->getBaseUrl(), 'baseSecureUrl' => $this->scope->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK, true)]; $this->subst = []; foreach ($placeholders as $key => $value) { $this->subst['from'][] = '{{' . $key . '}}'; $this->subst['to'][] = $value; } } return str_replace($this->subst['from'], $this->subst['to'], $xmlString); }