-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about Templates #382
Comments
The example "vendor/phpoffice/phpword/samples/Sample_07_TemplateCloneRow.php" answers your questions. |
I've seen this examle. But in this example says about table rows and I've asked about "text blocks". |
I think the problem is with Word, if you check the xml code you can notice the vars are not saved as well, Word insert many tags between the name of your var and the ${ } You can try deleting and retyping the tags but the setValue won't help you. |
See this issue: #341 My fix for the cloneBlock also includes the addition of _1 and _2 to variables within the cloned block |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hi, guys!
I've a problem with creating templates.
At first, I've created .docx file which contains this structure:
${clone}
${name}
${phone}
${email}
${/clone}
Then, I should clone content between ${clone} and ${/clone}. I use $document->cloneBlock('clone', 3); for it but nothing happens. When I open this generated file I see the same structure.
${clone}
${name}
${phone}
${email}
${/clone}
Could you help me? What should I do to clone this block?
And one more question. Can I use variables in the cloned block more than one time, somethings like this:
$document->setValue('name#1', 'Name 1');
$document->setValue('name#2', 'Name 2');
Best regards, Eugene
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: