Skip to content
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

using var in template (cloneBlock) #286

Open
jeje-50 opened this issue Jun 20, 2014 · 14 comments
Open

using var in template (cloneBlock) #286

jeje-50 opened this issue Jun 20, 2014 · 14 comments

Comments

@jeje-50
Copy link

jeje-50 commented Jun 20, 2014

I make some changes in cloneBlock function to increment variable name.
it cans be usefull for other people so i post code =)

http:https://pastebin.com/cZjeBfs3


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Progi1984
Copy link
Member

May be interesting for @RomanSyroeshko ?

@ghost
Copy link

ghost commented Jun 23, 2014

If I remember right, @ivanlanin merged the existing implementation of the cloneBlock method into the stream.

As for me, I don't like the idea of cloneBlock and cloneRow methods at all. It's just a temporary solution. The more we add temporary solutions the more we go far away from product solution.

@ivanlanin
Copy link
Contributor

I agree that those methods are temporary solutions. We should find time to redesign the template processor. The problem is, this is one of the most used/wanted functionality of PHPWord. People won't stop adding their suggested changes based on their needs :)

@ghost
Copy link

ghost commented Jun 23, 2014

So, we came to the situation when we need some kind of product development roadmap. Otherwise we will waste lot of time on clarifying the same things to different people. :)

@ivanlanin
Copy link
Contributor

You're right. I'll find some reference. Do you have any samples of that kind of roadmap?

@ghost
Copy link

ghost commented Jun 23, 2014

Nope. It's just a plan. I guess a simple list of a mid- and long-term changes will be enough for now. For example, "in the next 3 months we plan to do this, to fix that, and whatever". At least this stuff will give our users an overview of upcoming features and the direction of the product evolution. Now people do not see where the product goes. What about us? Do we know? :)

@ivanlanin
Copy link
Contributor

Nope. We don't know either :D

@Progi1984 Can we activate the wiki to put our thoughts together?

@Progi1984
Copy link
Member

@ivanlanin Done ;)

@ivanlanin
Copy link
Contributor

Thanks! I'll start writing ASAP.

@Federica92
Copy link

Hello, thanks for this, but I would like ask something about.
I'm using your code to clone the block, but if I try after to edit the content, this is not working, because 2 possible reason:
-the document is not well formatted
-some problem with zip() close in line 160.
Do you have any idea why? Thank you so much anyway, very useful.

@jeje-50
Copy link
Author

jeje-50 commented Jun 5, 2015

Hello,

If you have some code and an sample file i can look your problem

:)

@Federica92
Copy link

Thank you so much for the reply : ) I figured out the problem, just a second ago.
I create a new template.doc, and from that point, everything started to work again! So I guess that the template was only in the properly format.
Thank you a mil anyway!
Very very useful

@sudosumir
Copy link

Hi guys, I wanna know how I can modify the function codeBlock or where can I do that? I'm working with slim framework and for the installation of libraries it uses composer.

@FBnil
Copy link

FBnil commented Oct 3, 2017

@ispippen composer stores all installed code in ./vendor . You can find that function inside ./vendor/phpoffice/phpword/src/PhpWord/TemplateProcessor.php
Have a look at my code that also features the var#1 and var#2 when you clone blocks (and works in PHP7) https://github.com/FBnil/PHPWord/blob/FBnil-patch-blocks/src/PhpWord/TemplateProcessor.php

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
@PHPOffice PHPOffice deleted a comment from github-actions bot Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants