# |
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. |
# |
Jul 11th 2017, 11:39 |
hmic |
:p |
# |
Jul 11th 2017, 11:39 |
hmic |
it has not been changed anyways |
# |
Jul 11th 2017, 11:39 |
miks |
ohh thanks |
# |
Jul 11th 2017, 11:39 |
hmic |
miks, like you said: you cannot. |
# |
Jul 11th 2017, 11:38 |
miks |
is there a way to get the original virtual property? |
# |
Jul 11th 2017, 11:37 |
mallick |
thanks buddy :+1: |
# |
Jul 11th 2017, 11:37 |
hmic |
you could seperate it into a plugin, if that makes sense to you |
# |
Jul 11th 2017, 11:36 |
hmic |
mallick: use a prefix maybe? then use crud+crudview and your backend is done. |
# |
Jul 11th 2017, 11:36 |
mallick |
one quick question,, my project has two part,, one frontend and other is backend,, so what i do for backend??? make a plugin or what?? |
# |
Jul 11th 2017, 11:36 |
hmic |
so the answer is? |
# |
Jul 11th 2017, 11:35 |
miks |
but when i use $entity->getOriginal('virtual_property') it just gives me $entity['virtual_property'] |