# |
Jul 11th 2017, 13:56 |
willem |
@johnwayne yes i know, that is something different. |
# |
Jul 11th 2017, 13:56 |
jeremyharris |
diffForHumans |
# |
Jul 11th 2017, 13:56 |
jeremyharris |
https://book.cakephp.org/3.0/en/chronos.html#generating-differences |
# |
Jul 11th 2017, 13:56 |
johnwayne |
https://book.cakephp.org/3.0/en/core-libraries/time.html |
# |
Jul 11th 2017, 13:56 |
johnwayne |
isWithinNext('2 weeks') etc |
# |
Jul 11th 2017, 13:55 |
johnwayne |
@willem read core-libraries -> time there are isYesterday or isThisWeek |
# |
Jul 11th 2017, 13:55 |
willem |
i see most just use dateinteval with sprintf |
# |
Jul 11th 2017, 13:54 |
willem |
Is there a “timeToGoAsWords” e.g. you have 1 hour and 21 minutes left method somewhere in Cake/Chronos/PHP ? |
# |
Jul 11th 2017, 13:53 |
johnwayne |
And if I press ctrl+F5 it is working but it should work always.... |
# |
Jul 11th 2017, 13:49 |
johnwayne |
https://paste.ofcode.org/7JiKCtP5BDVabVpQXPQciJ |
# |
Jul 11th 2017, 13:49 |
johnwayne |
@jotpe yes, at the beggining I am using php function to determine from which country user comes (if Austria or Germany than use German, else use English).... And if I want to change language I am using this function |
# |
Jul 11th 2017, 13:48 |
slackebot |
~tell Erny_ about ruleone |
# |
Jul 11th 2017, 13:48 |
slackebot |
Command sent from Slack by admad: |
# |
Jul 11th 2017, 13:47 |
Erny_ |
hmic, yes, i'm using fallback routes |
# |
Jul 11th 2017, 13:46 |
Erny_ |
admad, no, i didn't know but it doesn't mind cause that was just an example. thankk btw :-P |
# |
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? |