View Decorators Video |
Hey all - I created a short video covering the new View Decorators in 4.2. It's only 5 minutes long and might give you some ideas on how to use it in your projects. I plan on doing several short videos like this for some of the other new features, so keep your eyes out for those.
New in CodeIgniter 4.2 - View Decorators
Yes!!!
This is great. I hope this method continues. The absence of this type of video in Codigniter is really felt. Thanks kilishan.
06-21-2023, 05:34 AM
(This post was last modified: 06-21-2023, 02:08 PM by RWCH. Edit Reason: Being a bit more clear (I hope) )
Hi @kilishan and/or any other senior member.
I have watched the video on decorators. Thank you for creating this nice feature. I have implemented them with success, but I have one question (which I also asked in the comments on YouTube). What to do if I want to have one or more specific decorators, based on my view? It is overkill to have ALL the decorators ALWAYS in the pipeline. Some views do not need to be decorated. I would like to specify which view(s) should be decorated by which decorator(s). As a workaround, I hoped that I could set the decorators array run time, but no luck. I ended up creating one decorator, which instantiates a SnippetProvider based on the current view (factory pattern). Works nicely, but I would have preferred the CodeIgniter framework to be a bit more flexible. Or did I miss something? Anyhow, thanks! |
Welcome Guest, Not a member yet? Register Sign In |