Hello,
Using HTML Extended, available in Premium licenses, you can call phpdocx methods from HTML tags. For example, using phpdocx_pagenumber (https://www.phpdocx.com/htmlapi-documentation/html-extended/insert-page-number-Word-document-with-HTML) you can insert page numbering.
On https://www.phpdocx.com/documentation/htmlapi-documentation you can read all supported HTML tags. On https://www.phpdocx.com/documentation/introduction/html-extended-to-word-PHP you can read more information about HTML Extended and CSS Extended.
Regards.