09.
Compiler Passes
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
8 Comments
Override extension configuration via compiler pass; I'm trying to override an existant api platform configuration
api_platform.mapping.pathsvia a some kinda of custom <a href="https://symfony.com/doc/current/service_container/compiler_passes.html">Compiler Pass</a>The goal is to merge my new configuration with the existing one
Here is the configuration part that I would like to update it at the height of the complication of my container:
This is my custom compiler pass:
And this is my root bundle where I registered my new custom compiler:
The problem that my new configuration is not taken into account and it's not working properly.
Hey ahmedbhs!
I think what you want is this: https://symfony.com/doc/cur...
The problem with a compiler pass is that they are *really* meant to modify *services* that API Platform created, but not its config directly. It's not working because API Platform has already used its configuration by this point - so you're modifying it too late.
So, try the above solution and let me know if you have any luck :).
Cheers!
Tell please how add compiller passes in symfony 4
I trying add this code in Kernel.php but it didn't work
`public function build(ContainerBuilder $container)
I also try implement CompillePassInterface in Kernel but this didnt work too
Hey Roman R.
You may find useful this new episode where Ryan implements a CompilerPass on Symfony4
https://symfonycasts.com/sc...
Or, you can read the docs here: https://symfony.com/doc/cur...
Cheers!
Dependency-injection-asaurus! xD
Hey Serge,
Haha, glad you like it! Should we reserve rights for this word? :D
Cheers!
You definitely should!
Then sell the rights to Universal Pictures so they include it in the new Jurassic World movie.
Lol! OK, calling our lawyers :D
Cheers!
"Houston: no signs of life"
Start the conversation!