Documentation: Injecting In Your Models

Is this still correct in the documentation?
https://coldbox.ortusbooks.com/the-basics/layouts-and-views#injecting-in-your-models

The renderer became singleton, but is says: renderer is a transient object.

Hey, @gunnar.lieb !

You’re definitely right - the Renderer became a singleton in ColdBox 6. So that part of the documentation is only correct for CB5 and below.

Could I trouble you to click “Edit in Github” in the docs sidebar, and remove the two sentences referencing “transient” in that docs page? It’s super easy to update the docs directly from Github that way, and the more members we can get to keep the docs maintained, the more accurate they will be for everyone.

I’m not sure if injecting the Renderer into a model changed in CB6 or not… I haven’t tried it out, but I’d guess you can simply do inject="coldbox:Renderer" instead of using the provider syntax. @bdw429s would you know? Does that provider section need to be dropped from the CB6 docs for injecting a Renderer into a model?

I would guess in Coldbox 6 you can just remove the provider namespace. Of course, it isn’t hurting anything being there. So far as I know, the coldbox:Renderer namespace is still the same.

I updated that docs page for CB6, FYI.

1 Like