Log message #4183884

# At Username Text
# Apr 18th, 14:49 this.impetus It alarms me terribly that I understand none of that :P
# Apr 18th, 14:49 ricksaccous i had no idea that it didn't load it until you used it
# Apr 18th, 14:48 ricksaccous interesting
# Apr 18th, 14:48 neon1024 .. a bit like a DI container
# Apr 18th, 14:48 neon1024 As if it can’t find the key, it’ll instantiate the object and set the instance to the key
# Apr 18th, 14:48 neon1024 At least that’s my understanding of how the object registry works
# Apr 18th, 14:48 neon1024 They don’t get instantiated in the registry until you use them anyway
# Apr 18th, 14:47 neon1024 I think it’s such a microscopic enhancement to selectivly load helpers in the controller method
# Apr 18th, 14:47 neon1024 Loading helpers in the AppView I guess
# Apr 18th, 14:47 neon1024 You shouldn’t be loading helpers in a template file
# Apr 18th, 14:46 ricksaccous but i don't think it makes a huge difference
# Apr 18th, 14:46 ricksaccous @neon1024 it probably makes more sense to manipulate that in the view class especially because the response is available to you there
# Apr 18th, 14:45 this.impetus got it. tyvm guys
# Apr 18th, 14:45 ricksaccous yeah that would be loadHelper
# Apr 18th, 14:44 ricksaccous which woul dbe
# Apr 18th, 14:44 ricksaccous yeah i'm saying in controller you would do $this->viewBuilder->setHelpers() and in the view you would use the other method i think
# Apr 18th, 14:43 this.impetus Sigh, I don't really even understand helpers, sorry. I mean conceptually I do, but I don't havea great concept of cake's architecture. What I *want* to achieve is a means of generating mouse-over thumbnails. The front-end JS stuff is where I am actually qualified. if only one class is going to be using this helper, is it not better to load it in the controller?
# Apr 18th, 14:42 neon1024 `$this->_viewBuilder->setHelpers();` ?
# Apr 18th, 14:41 ricksaccous and you would use a different method to do that
# Apr 18th, 14:41 ricksaccous but yes, it's probably better to add them in the AppView class
# Apr 18th, 14:41 ricksaccous you can add helpers that way
# Apr 18th, 14:41 this.impetus TBH, I *always* try. But I learned PHP years ago, and cake before it implemented namespace stuff, and I often find that I don't quite understand the API.
# Apr 18th, 14:41 neon1024 That’s not where you add helpers.
# Apr 18th, 14:41 ricksaccous lol
# Apr 18th, 14:41 ricksaccous he's using viewBuilder in controller
# Apr 18th, 14:40 neon1024 So the method does exist. Which means you must have a typo I’d imagine
# Apr 18th, 14:40 ricksaccous in your case setHelpers is more appropriate
# Apr 18th, 14:40 ricksaccous learn to use that more often and you'll have less questions in general
# Apr 18th, 14:40 neon1024 AppView::loadHelper has been in for 4 years
# Apr 18th, 14:39 ricksaccous ;)
# Apr 18th, 14:39 ricksaccous @this.impetus https://api.cakephp.org/3.7/class-Cake.View.ViewBuilder.html
# Apr 18th, 14:39 this.impetus ```$this->viewBuilder()->getHelpers(['Thumber.Thumb']);``` seems to have pleased cake
# Apr 18th, 14:39 ricksaccous actually it's best to check the API
# Apr 18th, 14:38 this.impetus yeah, haha. thanks. don't be surprised if I come back
# Apr 18th, 14:38 this.impetus anyway, I should at least try to solve this myself
# Apr 18th, 14:38 ricksaccous you can go through the docs to figure it out
# Apr 18th, 14:38 ricksaccous then figure out what the better method to use is
# Apr 18th, 14:38 this.impetus but I keep getting errors stating that `loadHelper` isn't a method
# Apr 18th, 14:38 ricksaccous hehe
# Apr 18th, 14:37 this.impetus oh? As in now that we know it's there and installed, use the current cake API to actually load it? yeah `->helpers` is deprecated
# Apr 18th, 14:37 ricksaccous is helpers deprecated?