Forum


Replies: 2   Views: 3104
Template issues
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 wpierson  · 01-07-2011 - 19:13

In both cases I am reading in from a template, and writing out to a file.

Is there a way to have linebreak when passing in a text variable. I want to write a line, then go to next line and write more.

Also is it possible to edit 2 images. I named them different thing in the alt, but both images seem to always get set to the same image.

Thank you

Posted by admin  · 11-04-2013 - 12:13

[quote][b]Quote from wpierson on July 1, 2011, 19:13[/b]
Is there a way to have linebreak when passing in a text variable. I want to write a line, then go to next line and write more.
[/quote]

Hello,

You can do linebreaks using an array; for example:

$text = array(
'David Hume',
'-----------',
'Bye'
);

$docx->addTemplateVariable('NAME', $text);

Please check intermediate/Template_multitext.php example.

Regards.