Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

could you update it for 4.1 version? #46

Open
lxregistry opened this issue Jun 18, 2018 · 5 comments
Open

could you update it for 4.1 version? #46

lxregistry opened this issue Jun 18, 2018 · 5 comments

Comments

@lxregistry
Copy link

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

@sampart
Copy link
Owner

sampart commented Jun 19, 2018

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.

@phtmgt
Copy link

phtmgt commented Jun 25, 2018

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.

@sampart
Copy link
Owner

sampart commented Jun 25, 2018

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

@phtmgt
Copy link

phtmgt commented Jun 27, 2018

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

@sampart
Copy link
Owner

sampart commented Jul 2, 2018

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

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

No branches or pull requests

3 participants