-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
[BUGFIX] Remember current template id #100
Conversation
A really dirty workaround |
Classes/Model/BasePDF.php
Outdated
} | ||
} | ||
|
||
public function setCurrentTemplateId(int $templateId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use type hints for primitive data types as we still support PHP 5.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still support PHP 5.6
I guess only for December, right? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are thinking about dropping support for PHP < 7 next year, yes. But if we do so, we would also like to add type hints to all functions and that would be considered a breaking change. Thus I am not yet sure how soon we will make this transition.
/** | ||
* @var int | ||
*/ | ||
protected $currentTemplateId = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this variable already declared in FpdfTplTrait
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is not. PHPStorm would have told me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see..a different trait is included, sry!
Thanks for the pull request!
If I get this correctly, that means that it works just as before? If you use |
Ceveat: A template with multiple pages will only use the first page of it Fixes bithost-gmbh#99
Updated the patch to be really working now and without typehints. |
Thanks, I will try to test and release this as soon as possible! |
This is a workaround. I'm not sure if this is the right thing to release actually. But I don't know how the inner stuff in fpdf works, so I guess you know better. |
Caveat: A template with multiple pages will only use the first page of it
Fixes #99