Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Element.php
Go to the documentation of this file.
1 <?php
7 
13 {
22  public function addAttribute($name, $value = null, $namespace = null)
23  {
24  if ($value !== null) {
25  $value = $this->xmlentities($value);
26  }
27  parent::addAttribute($name, $value, $namespace);
28  }
29 
38  public function addChild($name, $value = null, $namespace = null)
39  {
40  if ($value !== null) {
41  $value = $this->xmlentities($value);
42  }
43  return parent::addChild($name, $value, $namespace);
44  }
45 
52  public function xmlentities($value = null)
53  {
54  $value = str_replace('&amp;', '&', $value);
55  $value = str_replace('&', '&amp;', $value);
56  return $value;
57  }
58 }
addAttribute($name, $value=null, $namespace=null)
Definition: Element.php:22
$value
Definition: gender.phtml:16
addChild($name, $value=null, $namespace=null)
Definition: Element.php:38
if(!isset($_GET['name'])) $name
Definition: log.php:14