We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example xml:
<item> <image src=""> <image src=""> <image src=""> <image src=""> </item>
Example code:
$item= [ '@attributes' => $this->attributes, '@value' => [ 'language' => $this->language, 'author' => $this->author, 'category' => $this->category, ] ]; $dom = new \DOMDocument(); foreach ($this->images as $image) { $enclosure = $dom->createElement('image'); $enclosure->setAttribute('src', $image); $item['@value'][] = $enclosure; // error // $item['@value']['image'] = $enclosure; // ok, but incorrect structure and one only element allowed } $xml = new XMLReader(null); $xmlData = [ ... 'item' => $item, ]; $result = $xml->asXML([...], 'xml', [...]);
Thank you
The text was updated successfully, but these errors were encountered:
Hey, @1271.
Try to do so.
<?php include_once __DIR__ . '/vendor/autoload.php'; $items = [ '@attributes' => [], '@value' => [ 'language' => 'ru', 'author' => 'test', 'category' => 'test', 'image' => [ ['@attributes' => ['src' => ''], '@value' => ''], ['@attributes' => ['src' => ''], '@value' => ''], ['@attributes' => ['src' => ''], '@value' => ''], ['@attributes' => ['src' => ''], '@value' => ''], ] ] ]; $xml = new Bavix\XMLReader\XMLReader(); echo $xml->asXML($items, 'products');
Sorry, something went wrong.
No branches or pull requests
Example xml:
Example code:
Thank you
The text was updated successfully, but these errors were encountered: