JavaScript in a Flashbag


In this video we will take a look at how we could use the Flashbag in an interesting way to apply one shot JavaScript code to our page.

The are likely many reasons you could use this technique. However, it is not something I would actively encourage. Rather, it is interesting to know, and a tool to have in your arsenal for when absolutely needed.

The reasoning for using a technique like this may be to trigger calls to a remote / third party API that relies on JavaScript to send in 'interesting' activities inside your application. Maybe you have some custom tracking requirement that you only want to load on an as-needed basis.

I'm sharing this not because I think you should use it, but rather because it simply made me think - wow, that's a pretty cool way of using a feature I use all the time, but had never thought to use it in this way.

Hopefully you will find this technique interesting as well.

Episodes

# Title Duration
1 JavaScript in a Flashbag 05:10
2 Beginners Guide To Symfony Flash Messages 04:15