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

Simpler configuration and extension #33

Open
janfejtek opened this issue Dec 12, 2020 · 2 comments
Open

Simpler configuration and extension #33

janfejtek opened this issue Dec 12, 2020 · 2 comments

Comments

@janfejtek
Copy link

Currently, there is no global way to set default mpdf configuration or temp directory.
Configuration is constant in createMPDF() factory method. You have to create a factory for PDFResponse (and set createMPDF callback) or inherit PDFResponse class and override it or set it for each PDFResponse object

I propose following changes:

  1. Add static variables defaultConfig, defaultTempDir and defaultCreateMPDF which will be used if set. Config will be merged with current default config
  2. Add DI extension to have possibility to set these variables (maybe others like documentAutor) and automatically assign Nette temp dir. This will create dependency on nette/di

I think this can can be implemented without BC and I can create PR.

@jkuchar
Copy link
Owner

jkuchar commented Dec 20, 2020

I would prefer to have config/factory object (which can be registered into DI), which can then create PdfResponse objects

@jkuchar
Copy link
Owner

jkuchar commented Dec 20, 2020

Please go ahead and send PR! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants