Forum


Replies: 2   Views: 4413
Replace variable by word fragment using math equation
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by fpa.777  · 22-08-2014 - 13:53

Hello, I'm trying to run the following code in Trial Version: $docx = new createDocxFromTemplate('template.docx'); $link = new WordFragment($docx); $link->addLink('link to Google', array('url'=> 'http://www.google.es', 'color' => '0000FF', 'u' => 'single')); $math = new WordFragment($docx); $math->addMathEquation( 'x=b±b24ac2a', 'mathml' ); $docx->replaceVariableByWordFragment( array('BLOCK_FIRST' => $link, 'BLOCK_LAST' => $math) ); $docx->createDocx('myexample'); The equation fragment isn't added to the document, but the link fragment worked fine. I don't know if I'm not using this method correctly, or it doesn't work for adding math equations. Can anyone help please?