-
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
setComplexValue (link Element) by templateProcessor dosen't work properly. #1923
Comments
SOLVED by #1887 the following code works!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi everyone,
have an existing document,
inside it, I have a table with a placeholder for each row like ${url_N} with N from 0 to 9.
I'd like to insert dynamically a different link for each placeholder so i had write the following code:
$link = new PhpOffice\PhpWord\Element\Link('https://TEST.com', 'TEST', null, null, false);
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor($path_archive_dir . $filename);
$templateProcessor->setComplexValue('url_0', $link);
$templateProcessor->saveAs($path_archive_dir . $filename);
In this way, the string "TEST" is correctly substituted in the placeholder, but no link appears.
If, when creates the Link Element set at true the "$internal" argument
$link = new PhpOffice\PhpWord\Element\Link('https://TEST.com/', 'TEST', null, null, true);
Now the string seems to become a link, even if the link that appears on hover is "#https://TEST.com".
why the "#" appears?
At last but not least, no link is opened when clicked, finally, the link doesn't work!
Someone can help me?
The text was updated successfully, but these errors were encountered: