KNP Labs

KNP Labs “We offer Quality Development services for your Symfony project.” We only hire and train passionate developers: be sure that they will care about your code!

The KNP Labs agency was started in 2009 by developers for entrepreneurs, CTOs and communication agencies all over the world. Our goal is to help you make your Symfony2 project a success thanks to our experience with it − both in commercial and open-source projects.

Rewind ⏪ Design Patterns  #14Alrighty, it's the FINAL chapter of the Design Patterns tutorial! We override a core Symfon...
29/05/2026

Rewind ⏪ Design Patterns #14
Alrighty, it's the FINAL chapter of the Design Patterns tutorial! We override a core Symfony service by writing just *one* class, thanks to the decorator pattern & the #[AsDecorator] attribute. Plus we show where you can find decorators in the wild.

In Symfony, decoration has a secret super-power: it allows us to customize nearly *any* service inside of Symfony. Woh

Rewind ⏪ Design Patterns  #13How can you use the decorator pattern with Symfony's service container? Let's do it the "ma...
28/05/2026

Rewind ⏪ Design Patterns #13
How can you use the decorator pattern with Symfony's service container? Let's do it the "manual" way first: via a service alias from the interface and some clever wiring.

We just implemented the decorator pattern, where we basically wrapped the original "XpCalculator" in a warm hug with our "OutputtingXpCalculator". Then... we quietly slipped *that* into the system in place of the *original*... without anyone else - like "XpEarnedObserver&quo...

Rewind ⏪ Design Patterns  #12Time for the *final* design pattern... and maybe my favorite! It's the decorator pattern! L...
27/05/2026

Rewind ⏪ Design Patterns #12
Time for the *final* design pattern... and maybe my favorite! It's the decorator pattern! Let's define it and get it set up inside our app.

One more design pattern to go! And honestly, I think we may have saved the best for last. It's the *decorator* pattern

Symfony upgrades do not have to be scary 😌 Deprecations are your roadmap:Fix warnings in 7.4 → upgrade safely to Symfony...
26/05/2026

Symfony upgrades do not have to be scary 😌
Deprecations are your roadmap:
Fix warnings in 7.4 → upgrade safely to Symfony 8 🚀
0 deprecations = no surprises.

Symfony upgrades do not have to be stressful. Thanks to Symfony's deprecation system, you can fix future breaking changes before upgrading

25/05/2026

Symfony form tip 💡
`form_row()` renders everything.
`form_widget()` renders just the field itself.
Need full control?
Render the label, widget, errors, and help text separately 🎨

Rewind ⏪ Design Patterns  #11Happy Friday! Celebrate by dispatching fresh waffles & an extra cup of coffee to anyone tha...
22/05/2026

Rewind ⏪ Design Patterns #11
Happy Friday! Celebrate by dispatching fresh waffles & an extra cup of coffee to anyone that wants to listen. Yes, this was a Pub-Sub pattern joke...

We *are* able to run code right *before* a battle starts by registering what's called a "listener" to "FightStartingEvent". As you can see, a listener can be any function... though what we see here is a bit less common

Rewind ⏪ Design Patterns  #10Time for the pub-sub pattern! Which... is maybe more of a variation on the observer pattern...
21/05/2026

Rewind ⏪ Design Patterns #10
Time for the pub-sub pattern! Which... is maybe more of a variation on the observer pattern. Let's figure out the difference and see how we can dispatch & listen to an event directly in PHP.

The next pattern I want to talk about maybe *isn't* its own pattern? In reality, it's more of a *variation* of the observer pattern. It's called "pub/sub" or "publish-subscribe"

20/05/2026

SymfonyCasts Snippets:
Ahoy matey ⚓
YAML anchors & aliases let you define a piece of config once, then reuse it wherever you need it. Less duplication, more reuse, and your config files stay shipshape ⛵

Upgrading to Symfony 8  #5With the "hard" work behind us, the actual jump from Symfony 7.4 to 8.0 should be pretty easy....
19/05/2026

Upgrading to Symfony 8 #5
With the "hard" work behind us, the actual jump from Symfony 7.4 to 8.0 should be pretty easy. Plus, we'll check out a nifty Composer command afterward to confirm we have no outdated 😉 packages.

Symfony 7.4? Check

Rewind ⏪ Design Patterns  #9Such a fun way to wrap up the observer pattern! We see how this is implemented - in real lif...
15/05/2026

Rewind ⏪ Design Patterns #9
Such a fun way to wrap up the observer pattern! We see how this is implemented - in real life - in a Symfony app. This includes tags, autoconfiguration, a compiler pass and a method call. Woh!

We've implemented the Observer Pattern! The "GameApplication" is our subject, which notifies all of the observers... and we have *one* at the moment: "XpEarnedObserver". Inside "GameCommand", we connected all of this by *manually* instantiating the observer and "Xp...

Adresse

8q Rue Emile Péhant
Nantes
44000

Notifications

Soyez le premier à savoir et laissez-nous vous envoyer un courriel lorsque KNP Labs publie des nouvelles et des promotions. Votre adresse e-mail ne sera pas utilisée à d'autres fins, et vous pouvez vous désabonner à tout moment.

Partager