WhiteOctoberTCPDFBundle icon indicating copy to clipboard operation
WhiteOctoberTCPDFBundle copied to clipboard

could you update it for 4.1 version?

Open lxregistry opened this issue 6 years ago • 5 comments

Service "white_october.tcpdf" not found: even though it exists in the app's container, the container inside

lxregistry avatar Jun 18 '18 15:06 lxregistry

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.

sampart avatar Jun 19 '18 08:06 sampart

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.

phtmgt avatar Jun 25 '18 10:06 phtmgt

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 avatar Jun 25 '18 11:06 sampart

@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.

phtmgt avatar Jun 27 '18 07:06 phtmgt

@finkbg that's fine - both approaches are valid.

sampart avatar Jul 02 '18 11:07 sampart