# |
Jul 11th 2017, 13:44 |
admad |
yeah i guess it would be better |
# |
Jul 11th 2017, 13:43 |
hmic |
it's like not providing the json and xml extensions mapped by default, but having the _serialize setup in the baked controllers .-/ |
# |
Jul 11th 2017, 13:43 |
hmic |
it makes it way harder for ppl to learn about routing with that magic in place - by default |
# |
Jul 11th 2017, 13:42 |
hmic |
i do actually think the fallbackroutes should be removed and the code put in the default apps routes.php directly |
# |
Jul 11th 2017, 13:42 |
admad |
if the former than doesn't really make much sense, just use index(); if the latter, yeah he'll learn something new today :slightly_smiling_face: |
# |
Jul 11th 2017, 13:41 |
hmic |
admad: he might have them called differently, or he will figure out soon :p |
# |
Jul 11th 2017, 13:40 |
admad |
Erny_: you know you can't have class methods named "list" in PHP right? |
# |
Jul 11th 2017, 13:40 |
hmic |
- check the source on what it does, it's very easy to do yourself with a different / (index) action |
# |
Jul 11th 2017, 13:39 |
hmic |
you are using fallback routes i suppose for wireing the defaults up now, do you? |
# |
Jul 11th 2017, 13:39 |
hmic |
so you just set them this way |
# |
Jul 11th 2017, 13:38 |
Erny_ |
hmic: /articles should point to /articles/list instead of /articles/index, the same way /orders should point to /orders/list instead of /orders/index |
# |
Jul 11th 2017, 13:37 |
hmic |
one route has one destination, not "all your controllers" |
# |
Jul 11th 2017, 13:37 |
hmic |
Erny_, what do you mean by that? |
# |
Jul 11th 2017, 13:37 |
Erny_ |
Hi all. I'm having problems understanding how Cake 3 router works. How can i change the default action for all of my controllers? |
# |
Jul 11th 2017, 13:33 |
jotpe |
@johnwayne is $myLang the result of $session->check('Config.language') ? Do you set the Config.language for the session? |
# |
Jul 11th 2017, 13:32 |
neon1024 |
Oh, or a configure value ;P |
# |
Jul 11th 2017, 13:32 |
neon1024 |
Sounds like you’re using a session |
# |
Jul 11th 2017, 13:23 |
johnwayne |
https://paste.ofcode.org/VRastAivBpmtgsjprmau73 |
# |
Jul 11th 2017, 13:23 |
johnwayne |
I am using in beforeFilter and before Render function change_language methode.... but only if I press ctrl+F5 (first time after I click on change language flag) site change language before not.... |
# |
Jul 11th 2017, 13:23 |
jotpe |
for some reason Cake looks for a csv view?! ```Error: [MissingViewException] View file "/XXX/app/Plugin/News/View/News/csv/index.ctp" is missing.``` |
# |
Jul 11th 2017, 13:22 |
jotpe |
hello. I've got a MissingViewException when using $this->render('index'); I have a valid view and the frontend is rendered correctly |
# |
Jul 11th 2017, 12:10 |
bernat |
the test cases is the only place I've found the fourth argument used but still no explanations. |
# |
Jul 11th 2017, 12:09 |
bernat |
I've already checked the api and test cases |
# |
Jul 11th 2017, 12:09 |
bernat |
Am I using the CounterCacheBehavior in the wrong way ignoring the fourth argument? |
# |
Jul 11th 2017, 12:08 |
admad |
bernat: check api and test cases |
# |
Jul 11th 2017, 11:57 |
bernat |
I'm looking at the CounterCacheBehavior class and I see that it uses a fourth argument when calling a custom count function. I think I have to use that fourth argument to calculate the count for the newly associated entity or the old one. I haven't found anything about this in the docs and I'm a bit confused. There's some more info or examples about how this fourth argument should be used? |
# |
Jul 11th 2017, 11:50 |
hmic |
a pull request |
# |
Jul 11th 2017, 11:49 |
miks |
when you said [15:40] <hmic> maybe you implement it and setup a PR? could be interesting, maybe. |
# |
Jul 11th 2017, 11:49 |
miks |
btw, whats a PR? |
# |
Jul 11th 2017, 11:46 |
miks |
i see... thanks |
# |
Jul 11th 2017, 11:44 |
hmic |
if your beforesave has insight and acts upon the data in the entity, you can make it act upon the real data, not the virtual one too... |
# |
Jul 11th 2017, 11:44 |
hmic |
as you do not save that virtual property to the database anyways, your beforeSave does not need to care... |
# |
Jul 11th 2017, 11:44 |
hmic |
the virtual properties are dependent on the current state of the entity - you implemented it this way! |
# |
Jul 11th 2017, 11:42 |
miks |
when i run $entity['virtual_property'] it gives me 'value1' but when i run $entity->getOriginal('virtual_property') i was expecting 'value 2' but gave me 'value 1' |
# |
Jul 11th 2017, 11:42 |
hmic |
sure |
# |
Jul 11th 2017, 11:41 |
miks |
then i have a virtual function which returns "value1" if property == 1 and 'value2' if property == 2 |
# |
Jul 11th 2017, 11:41 |
hmic |
sure |
# |
Jul 11th 2017, 11:41 |
miks |
when i use $entity['property'] it gives me 1 and when i use $entity->getOriginal('property') it gives me 2 |
# |
Jul 11th 2017, 11:40 |
miks |
i made a behavior, and inside the behavior there is a beforeSave |
# |
Jul 11th 2017, 11:40 |
hmic |
maybe you implement it and setup a PR? could be interesting, maybe. |
# |
Jul 11th 2017, 11:40 |
miks |
i'm confused. Let me explain my situation. |