Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert XmlText to HTML - eZ Publish 5
{% set html = content.getFieldValue( "my_xmltext_field" ).xml|xmltext_to_html5 %}
{{ html }}
// Assuming you're in a controller
$xmlTextValue = $myContent->getFieldValue( 'my_xmltext_field' );
/** @var \eZ\Publish\Core\FieldType\XmlText\Converter\Html5 $html5Converter */
$html5Converter = $this->get( 'ezpublish.fieldType.ezxmltext.converter.html5' );
$html = $html5Converter->convert( $xmlTextValue->xml );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.