# |
Aug 19th 2019, 12:33 |
ricksaccous |
yeah you can either ask explicitly for json or set that header in the request |
# |
Aug 19th 2019, 12:32 |
admad |
extension are optional but then the client needs to set proper `Accept` so that requesthandler knows it has to switch response type |
# |
Aug 19th 2019, 12:32 |
royalty |
show me the link you're generating in html |
# |
Aug 19th 2019, 12:31 |
royalty |
why would you disable them? |
# |
Aug 19th 2019, 12:31 |
Nitrogen |
hm, looks like extension routes are optional. and disabling them didn't change the outcome. to answer the rest of your questions. I'm not setting view classes explicitly. And RequestHandler is loaded. |
# |
Aug 19th 2019, 12:18 |
Nitrogen |
esp. since I wasn't asking for .json |
# |
Aug 19th 2019, 12:17 |
Nitrogen |
ah, got abandoned route extension for json. this might be it. |
# |
Aug 19th 2019, 12:17 |
ricksaccous |
are you asking for .json |
# |
Aug 19th 2019, 12:16 |
ricksaccous |
are json extensions enabled in your routes |
# |
Aug 19th 2019, 12:16 |
ricksaccous |
are you loading requesthandler component or whatever it is |
# |
Aug 19th 2019, 12:16 |
ricksaccous |
are you setting a view class anywhere? |
# |
Aug 19th 2019, 12:16 |
Nitrogen |
I'm on 3.5.10 btw |
# |
Aug 19th 2019, 12:15 |
Nitrogen |
hey guys. cake is giving me trouble demanding json template, while documentation states _serialize is essentially the only thing I need to get rolling. any clues to what might be off? |
# |
Aug 19th 2019, 12:09 |
ricksaccous |
and act accordingly |
# |
Aug 19th 2019, 12:09 |
ricksaccous |
to see if they were passed or not |
# |
Aug 19th 2019, 12:09 |
ricksaccous |
oh i suppose you do need the extra logic |
# |
Aug 19th 2019, 12:09 |
ricksaccous |
i suppose, i don't really validate my params |
# |
Aug 19th 2019, 12:08 |
k4t |
@ricksaccous with that approach there is important trade off - I have to validate params manually in the action instead of inside of route definition |
# |
Aug 19th 2019, 12:02 |
unclezoot |
afternoon, is there a way to do streamed download using \Cake\Network\Http\Client? using it to get an oauth2 access token and would prefer not to use cURL for the download |
# |
Aug 19th 2019, 11:55 |
ricksaccous |
one action/one route is fine |
# |
Aug 19th 2019, 11:55 |
ricksaccous |
that's what i would do, just edit the query, etc, based on params |
# |
Aug 19th 2019, 11:54 |
k4t |
maybe I should declare only one action and one route to that action with wildcard for params? |
# |
Aug 19th 2019, 11:53 |
k4t |
https://gist.github.com/K4T/3d88fbb23733ad935f60e46d77aa004c how would you simply such duplicated actions code? |
# |
Aug 19th 2019, 11:53 |
k4t |
may I ask you for an advice? |
# |
Aug 19th 2019, 11:53 |
k4t |
Hi all |
# |
Aug 19th 2019, 11:38 |
admad |
but iirc the trait still uses/needs the component |
# |
Aug 19th 2019, 11:37 |
admad |
yes |
# |
Aug 19th 2019, 11:30 |
neon1024 |
How is it that I’ve unloaded the CrudComponent but it still works? Is that the trait doing that? |
# |
Aug 19th 2019, 11:12 |
admad |
@conehead hasOne would generate joins so it would be essentially same and manual joins |
# |
Aug 19th 2019, 11:11 |
admad |
Hehe |
# |
Aug 19th 2019, 11:11 |
neon1024 |
Haha, well for all we know you might be called Mark @admad |
# |
Aug 19th 2019, 11:10 |
slackebot |
Action: admad ehm |
# |
Aug 19th 2019, 11:07 |
neon1024 |
It’s like the lead developers made up the rule :P |
# |
Aug 19th 2019, 11:06 |
neon1024 |
As you can’t get onto the Cake core team unless you’re named Mark or José |
# |
Aug 19th 2019, 11:06 |
neon1024 |
Well, one of the José’s |
# |
Aug 19th 2019, 11:06 |
neon1024 |
The only person who might be able to actually answer would be José |
# |
Aug 19th 2019, 11:04 |
conehead |
I will give it a shot tomorrow...and will let you know ;) |
# |
Aug 19th 2019, 11:04 |
neon1024 |
Such as the indexes we touched on a moment ago |
# |
Aug 19th 2019, 11:04 |
neon1024 |
If you’re getting into these kinds of optimisations, then they are incredibly environment specific |
# |
Aug 19th 2019, 11:03 |
neon1024 |
@conehead Because every application and environment is different |
# |
Aug 19th 2019, 11:03 |
neon1024 |
Sorry, I just found it `$this->modelClass = false;` |