| @@ 64-76 (lines=13) @@ | ||
| 61 | * @param string $element Nom de la balise |
|
| 62 | * @param array $attributes (default: array()) Les attributs de la balise |
|
| 63 | */ |
|
| 64 | public function push($element, $attributes = array()) |
|
| 65 | { |
|
| 66 | $this->_indent(); |
|
| 67 | $this->xml .= '<'.$element; |
|
| 68 | ||
| 69 | foreach ($attributes as $key => $value) |
|
| 70 | { |
|
| 71 | $this->xml .= ' '.$key.'="'.utf8_encode($value).'"'; |
|
| 72 | } |
|
| 73 | ||
| 74 | $this->xml .= ">\n"; |
|
| 75 | $this->stack[] = $element; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * Créer une balise simple, avec ces attributs et son contenu |
|
| @@ 124-135 (lines=12) @@ | ||
| 121 | * @param string $element Nom de la balise |
|
| 122 | * @param array $attributes (default: array()) Les attributs de la balise |
|
| 123 | */ |
|
| 124 | public function emptyelement($element, $attributes = array()) |
|
| 125 | { |
|
| 126 | $this->_indent(); |
|
| 127 | $this->xml .= '<'.$element; |
|
| 128 | ||
| 129 | foreach ($attributes as $key => $value) |
|
| 130 | { |
|
| 131 | $this->xml .= ' '.$key.'="'.utf8_encode($value).'"'; |
|
| 132 | } |
|
| 133 | ||
| 134 | $this->xml .= " />\n"; |
|
| 135 | } |
|
| 136 | ||
| 137 | /** |
|
| 138 | * Ferme une balise ouverte avec push() |
|