Body and its descendants Docx and Docxxml - parser class. This class is needed for getting access to template content. Allows to replace placeholders with actual values.

Class methods

__construct($content)Object constructor. Receives content as string.
getPlaceholders()The method parses file content and sends all its placeholders as an array.
setValues(array $values)Method sets placeholder values, receives an array, where key - field name, value - field content.
getContent()Method passes file content.
process()Method replaces placeholders with values. Returns \Bitrix\Main\Result
save($filename = '', \Bitrix\DocumentGenerator\Storage $storage = null)Method saves content in new file with the name $filename, passes ID from \Bitrix\DocumentGenerator\Model\FileTable. When passing the object $storage, its used for saving value.

© «Bitrix24», 2001-2023