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:
$model->toXml('utf-8');
Result:
<?xml version="1.0" encoding="utf-8"?><trains id="123"><train id="1"><name>Сапасан</name><departure>Москва</departure></train></trains>
Сurrently the result:
$model->toXml();
<?xml version="1.0"?><trains id="123"><train id="1"><name>Сапасан</name><departure>Москва</departure></train></trains>
I would have done it myself, but I can not find where to "dig."
The text was updated successfully, but these errors were encountered:
Found: /src/Mapper/XmlModelMapper.php (version 2.2.16) line 270
$elementXml = '<'.$elementName.'></'.$elementName.'>';
replace
$elementXml = '<?xml version="1.0" encoding="utf-8"?><'.$elementName.'></'.$elementName.'>';
but how to pass the encoding if you do not need utf-8
Sorry, something went wrong.
Or:
/** * @return string */ public function toXml() { $mapper = new XmlModelMapper(); return $mapper->unmap($this); }
/** * @return string */ public function toXml() { $mapper = new XmlModelMapper(); return mb_convert_encoding($mapper->unmap($this), 'UTF-8', 'HTML-ENTITIES'); }
I may have a solution for this, let me check and get back to you.
No branches or pull requests
Example:
Result:
Сurrently the result:
I would have done it myself, but I can not find where to "dig."
The text was updated successfully, but these errors were encountered: