WhiteOctoberTCPDFBundle
WhiteOctoberTCPDFBundle copied to clipboard
could you update it for 4.1 version?
Service "white_october.tcpdf" not found: even though it exists in the app's container, the container inside
Hi @lxregistry, thanks for your feedback.
Have you added the bundle to config/bundles.php
? There's not yet a Symfony Flex recipe for this project, so this won't happen automatically.
It works in 4.1. Just make sure you make the service public in your config/services.yaml like that:
services:
...
white_october.tcpdf.public:
alias: white_october.tcpdf
public: true
And instead of $this->get('white_october.tcpdf'), use $this->get('white_october.tcpdf.public').
Cheers.
Thanks for contributing, @finkbg! You can also configure it for service-autowiring and pass it as a parameter into your controller method - I've just added that to the docs (see https://github.com/whiteoctober/WhiteOctoberTCPDFBundle/pull/48/files).
@sampart I tried making it work like that initially, but couldn't figure out how to type-hint the service, so the solution I shared was my workaround to that.
@finkbg that's fine - both approaches are valid.