Log message #4018303

# At Username Text
# Apr 20th 2017, 12:23 spriz If you'd test something in an afterSave in a table class, how would you fake the entity property of the afterSave?
# Apr 20th 2017, 12:23 Junior I have the table model inshide the plugin :)
# Apr 20th 2017, 12:22 inoas Users ;)?
# Apr 20th 2017, 12:22 Junior inoas, partially i saw something very strange . If i do $this->loadModel('AuthAcl.Uses') it doesn't work
# Apr 20th 2017, 12:16 crazycoder hi inoas
# Apr 20th 2017, 12:02 inoas Junior: could you solve footprint ?
# Apr 20th 2017, 11:58 spriz Whenever i put anything in the second argument of getMockForModel, I get PDO Exception - anyone can guide me in some direction? :thinking_face:
# Apr 20th 2017, 11:56 Junior nevermind, i am stupid :))
# Apr 20th 2017, 11:49 Junior I am inside AuthAcl plugin and setting class UsersTable extends \App\Model\Table\AppTable and debug("aaaa"); in the AppTable doesn't work, any ideas why?
# Apr 20th 2017, 11:40 crazycoder i am using a custom errorrenderer https://gist.github.com/anonymous/b87f711b96154aed69ad57a3d742393c
# Apr 20th 2017, 11:39 crazycoder is there something more...elegant ?
# Apr 20th 2017, 11:38 crazycoder guys is correct echo json_encode($this->viewVars); inside a view called after an exception ? (json request)
# Apr 20th 2017, 11:31 xety Hmm nice idea, i will try that, thanks !
# Apr 20th 2017, 11:29 Neon1024 Sounds like something I’d do in a helper myself
# Apr 20th 2017, 11:28 xety Hello, Someone know how can i apply a function to all the `i18nFormat` call ? Actually i'm doing that : ``` ?= ucwords($poll->end_date->i18nFormat([\IntlDateFormatter::FULL, \IntlDateFormatter::SHORT])) ? ``` But i'm tired to repeat each time the `ucwords()` function. Or maybe there is an option ? I saw nothing about that in the doc.
# Apr 20th 2017, 11:07 inoas similar to always using === / !== even if type does not matter
# Apr 20th 2017, 11:07 inoas then you don't have to think about if type matters or not
# Apr 20th 2017, 11:07 inoas I am saying in general we should use in_array($x, $y, true) aka the default way to use things
# Apr 20th 2017, 11:07 inoas https://github.com/cakephp/cakephp/pull/10561#discussion_r112426055
# Apr 20th 2017, 10:09 Guest3372 anyone who could help me with RESTful routing? :)
# Apr 20th 2017, 09:59 Guest3372 hello
# Apr 20th 2017, 09:41 crazycoder $this->controller->request->header('Content-type') already returns application/json
# Apr 20th 2017, 09:40 Neon1024 Good luck :)
# Apr 20th 2017, 09:40 Neon1024 Okay, I’m out.
# Apr 20th 2017, 09:40 crazycoder i checked it via postman
# Apr 20th 2017, 09:40 Neon1024 Fourth time round!
# Apr 20th 2017, 09:40 crazycoder Neon1024, no
# Apr 20th 2017, 09:40 charolastra Neon1024: and do the switch case inside the elements?
# Apr 20th 2017, 09:40 crazycoder it is not an optimization... i have to skip the .json ext
# Apr 20th 2017, 09:40 Neon1024 Back to the middleware headers.. again
# Apr 20th 2017, 09:40 Neon1024 But if you had the headers you’d get true
# Apr 20th 2017, 09:40 crazycoder so i must do it
# Apr 20th 2017, 09:40 crazycoder Neon1024, no i think you did not understand me :D if i do debug(...is('json')) i get FALSE because i am not using .json extension
# Apr 20th 2017, 09:39 Neon1024 It’s a waste of your time
# Apr 20th 2017, 09:39 Neon1024 You’re investing minutes to save thousands of a millisecond
# Apr 20th 2017, 09:38 Neon1024 That’s micro-optimisation
# Apr 20th 2017, 09:38 Neon1024 Who cares what it checks
# Apr 20th 2017, 09:38 crazycoder so i must do something like if ($this->controller->request->header('Content-type') == 'application/json') { ... }
# Apr 20th 2017, 09:38 crazycoder Neon1024, no no wait..i am saying it checks the extension AND the headers...but in this case we do not need the ext checks
# Apr 20th 2017, 09:37 Neon1024 charolastra: I’d use elements to build the form
# Apr 20th 2017, 09:37 Neon1024 It would be a pretty crappy detector if it just relied on the extension and not the headers!