parseTranslatableNodeList example



        $options = [];

        /** @var DOMElement $storeOption */
        foreach ($storeOptions as $storeOption) {
            $value = '';
            if ($optionValue = $storeOption->getElementsByTagName('value')->item(0)) {
                $value = $optionValue->nodeValue;
            }

            $label = XmlReaderBase::parseTranslatableNodeList(
                $storeOption->getElementsByTagName('label')
            );

            $options[] = [
                $value,
                $label,
            ];
        }

        return $options;
    }
}


        $pluginData = $plugin->item(0);
        if (!$pluginData instanceof DOMElement) {
            return [];
        }

        $info = [];

        $label = $xpath->query('//plugin/label');
        if ($label instanceof DOMNodeList) {
            $label = self::parseTranslatableNodeList($label);
            if ($label) {
                $info['label'] = $label;
            }
        }

        $description = $xpath->query('//plugin/description');
        if ($description instanceof DOMNodeList) {
            $description = self::parseTranslatableNodeList($description);
            if ($description) {
                $info['description'] = $description;
            }
        }

        $xpath = new DOMXPath($xml);

        $form = [
            'label' => [],
            'description' => [],
            'elements' => [],
        ];

        $label = $xpath->query('//config/label');
        if ($label instanceof DOMNodeList) {
            $form['label'] = self::parseTranslatableNodeList($label);
        }

        $description = $xpath->query('//config/description');
        if ($description instanceof DOMNodeList) {
            $form['description'] = self::parseTranslatableNodeList($description);
        }

        $elements = $xpath->query('//config/elements/element');
        if ($elements instanceof DOMNodeList) {
            $form['elements'] = $this->parseElementNodeList($elements);
        }

        
Home | Imprint | This part of the site doesn't use cookies.