# |
Apr 18th 2019, 15:50 |
admad |
https://github.com/cakephp/cakephp.org |
# |
Apr 18th 2019, 15:49 |
mrfeedback |
hmm i have no idea where to put the PR for the website? :slightly_smiling_face: |
# |
Apr 18th 2019, 15:45 |
admad |
@mrfeedback make a PR :slightly_smiling_face: |
# |
Apr 18th 2019, 15:42 |
mrfeedback |
i think you can remove the Google+ Button on the website :) |
# |
Apr 18th 2019, 15:38 |
this.impetus |
@admad check, will do, ty |
# |
Apr 18th 2019, 15:37 |
admad |
@this.impetus you might also want to consider https://github.com/admad/cakephp-glide |
# |
Apr 18th 2019, 14:49 |
ricksaccous |
lol |
# |
Apr 18th 2019, 14:49 |
neon1024 |
https://github.com/cakephp/cakephp/blob/master/src/Core/ObjectRegistry.php#L97 |
# |
Apr 18th 2019, 14:49 |
ricksaccous |
well actually that makes sense |
# |
Apr 18th 2019, 14:49 |
ricksaccous |
or it didn't instantiate it |
# |
Apr 18th 2019, 14:49 |
this.impetus |
It alarms me terribly that I understand none of that :P |
# |
Apr 18th 2019, 14:49 |
ricksaccous |
i had no idea that it didn't load it until you used it |
# |
Apr 18th 2019, 14:48 |
ricksaccous |
interesting |
# |
Apr 18th 2019, 14:48 |
neon1024 |
.. a bit like a DI container |
# |
Apr 18th 2019, 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 2019, 14:48 |
neon1024 |
At least that’s my understanding of how the object registry works |
# |
Apr 18th 2019, 14:48 |
neon1024 |
They don’t get instantiated in the registry until you use them anyway |
# |
Apr 18th 2019, 14:47 |
neon1024 |
I think it’s such a microscopic enhancement to selectivly load helpers in the controller method |
# |
Apr 18th 2019, 14:47 |
neon1024 |
Loading helpers in the AppView I guess |
# |
Apr 18th 2019, 14:47 |
neon1024 |
You shouldn’t be loading helpers in a template file |
# |
Apr 18th 2019, 14:46 |
ricksaccous |
but i don't think it makes a huge difference |
# |
Apr 18th 2019, 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 2019, 14:45 |
this.impetus |
got it. tyvm guys |
# |
Apr 18th 2019, 14:45 |
ricksaccous |
yeah that would be loadHelper |
# |
Apr 18th 2019, 14:44 |
ricksaccous |
which woul dbe |
# |
Apr 18th 2019, 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 2019, 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 2019, 14:42 |
neon1024 |
`$this->_viewBuilder->setHelpers();` ? |
# |
Apr 18th 2019, 14:41 |
ricksaccous |
and you would use a different method to do that |
# |
Apr 18th 2019, 14:41 |
ricksaccous |
but yes, it's probably better to add them in the AppView class |
# |
Apr 18th 2019, 14:41 |
ricksaccous |
you can add helpers that way |
# |
Apr 18th 2019, 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 2019, 14:41 |
neon1024 |
That’s not where you add helpers. |
# |
Apr 18th 2019, 14:41 |
ricksaccous |
lol |
# |
Apr 18th 2019, 14:41 |
ricksaccous |
he's using viewBuilder in controller |
# |
Apr 18th 2019, 14:40 |
neon1024 |
So the method does exist. Which means you must have a typo I’d imagine |
# |
Apr 18th 2019, 14:40 |
ricksaccous |
in your case setHelpers is more appropriate |
# |
Apr 18th 2019, 14:40 |
ricksaccous |
learn to use that more often and you'll have less questions in general |
# |
Apr 18th 2019, 14:40 |
neon1024 |
AppView::loadHelper has been in for 4 years |
# |
Apr 18th 2019, 14:39 |
ricksaccous |
;) |
# |
Apr 18th 2019, 14:39 |
ricksaccous |
@this.impetus https://api.cakephp.org/3.7/class-Cake.View.ViewBuilder.html |