Hello,
When I'm trying to add HTML into a document, I am seeing a couple warnings arise:
"Strict standards: Accessing static property HTML2WordML::$customListStyles as non static in phpdocx/classes/HTML2WordML.inc on line 46"
The code still works fine, but it's generating the warnings. Any thoughts why? I have confirmed the variables all exist.
My code:
class merger {
public function parse_variables( $variables, $existing_file, &$new_docx_filename ) {
$docx = new createDocx();
$docx->addTemplate( $existing_file );
$html_var_options = array(
'isFile' => false,
'baseURL' => '',
'customListStyles' => '',
'downloadImages' => 'false',
'filter' => null,
'parseAnchors' => false,
'parseDivsAsPs' => true,
'parseFloats' => true,
'strictWordStyles' => false,
'wordStyles' => null
);
foreach( $variables as $v ) {
$docx->replaceTemplateVariableByHTML( $v['to_replace'], 'inline', $v['replace_with'], $html_var_options );
}
$docx->createDocx( $new_docx_filename );
unset($docx);
$new_docx_filename .= ".docx";
}
}
$variables = array(
array(
'to_replace' => 'TOC_LIST',
'replace_with' => nl2br( $_REQUEST['toc_contents'] ),
'method' => 'replaceTemplateVariableByHTML'
),
array(
'to_replace' => 'TOC_PAGES',
'replace_with' => implode( "<br>", $merger->page_counts ),
'method' => 'replaceTemplateVariableByHTML'
),
);
$merger->parse_variables( $variables, $existing_file, $new_docx_filename );