Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HtmlContent.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  public function convert(\DOMNode $node, array $data)
20  {
21  $items = [];
23  if ($node->nodeType == XML_ELEMENT_NODE) {
24  $xml = '<?xml version="1.0"?>' . "\n"
25  . '<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . "\n"
26  . $node->ownerDocument->saveXML($node) . "\n"
27  . '</layout>';
28  $items['layout']['xsi:type'] = 'string';
29  $items['layout']['name'] = 'layout';
30  $items['layout']['value'] = $xml;
31 
32  $items['name']['xsi:type'] = 'string';
33  $items['name']['name'] = 'block';
34  $items['name']['value'] = $node->getAttribute('name');
35  }
36  return [
37  'xsi:type' => 'array',
38  'item' => $items
39  ];
40  }
41 }
convert(\DOMNode $node, array $data)
$items