Log message #4098404

# At Username Text
# Nov 23rd 2017, 11:35 neon1024 Crud is super flexible like that <3
# Nov 23rd 2017, 11:35 neon1024 I mean you don’t even need to do that if you don’t want to
# Nov 23rd 2017, 11:35 neon1024 As long as you return `$this->Crud->execute()` you can do whatever you want in the controller method
# Nov 23rd 2017, 11:34 neon1024 Just do some stuff, then pass off to Crud
# Nov 23rd 2017, 11:33 neon1024 Me? No, I’d just change the data array in the controller most likely
# Nov 23rd 2017, 11:33 birdy247 in beforeMarsahal?
# Nov 23rd 2017, 11:33 birdy247 :+1:
# Nov 23rd 2017, 11:33 neon1024 But that would be my approach anyway, I’d make the ajax nice and simple and obvious, then I’d do a spot of data manipulation in PHP :slightly_smiling_face:
# Nov 23rd 2017, 11:32 neon1024 Crud adds events, it doesn’t replace the core ones :slightly_smiling_face:
# Nov 23rd 2017, 11:31 birdy247 is there a beforeMarshal event I can use with crud?
# Nov 23rd 2017, 11:31 neon1024 Just post the stuff and fix it in PHP
# Nov 23rd 2017, 11:31 neon1024 You don’t need to make your front-end complicated
# Nov 23rd 2017, 11:31 neon1024 So give it what it wants
# Nov 23rd 2017, 11:31 birdy247 the string and timezone
# Nov 23rd 2017, 11:31 birdy247 which expects an array of dates
# Nov 23rd 2017, 11:31 birdy247 I have a custom data type
# Nov 23rd 2017, 11:30 neon1024 Don’t tie your own shoelaces together before the race and then cry when you fall over!
# Nov 23rd 2017, 11:30 neon1024 Well just use `date` and `timezone` then
# Nov 23rd 2017, 11:30 birdy247 but this is an ajax post request
# Nov 23rd 2017, 11:30 neon1024 Why you don’t you use `Y-m-d H:i:s` ?
# Nov 23rd 2017, 11:29 birdy247 yes, works fine
# Nov 23rd 2017, 11:29 neon1024 `$this->Form->control('date.date', ['type' => 'date']);` right?
# Nov 23rd 2017, 11:29 neon1024 To me that’s bad form input naming
# Nov 23rd 2017, 11:27 birdy247 File uploaded https://cakesf.slack.com/files/U0T295QA3/F85HL6Q1L/-.php / https://slack-files.com/T053DPNCM-F85HL6Q1L-5cbd0fcd38
# Nov 23rd 2017, 11:25 birdy247 but when i check the request getData its like [data[date]] = '01/01/2017'
# Nov 23rd 2017, 11:25 birdy247 I am trying to post date[date] = '01/01/2017'
# Nov 23rd 2017, 11:25 neon1024 Or just just a plain old `if ($this->request->is('post')) { Log::debug('Holy salmon fingers Batman!'); }`
# Nov 23rd 2017, 11:25 birdy247 My problem is this
# Nov 23rd 2017, 11:24 neon1024 Perhaps try a beforeSave or something
# Nov 23rd 2017, 11:23 birdy247 ah, I see
# Nov 23rd 2017, 11:21 neon1024 Because it’s already happened by the time your controller action is executed
# Nov 23rd 2017, 11:20 neon1024 So you’ll never be able to catch it in a controller action
# Nov 23rd 2017, 11:20 birdy247 Crud.beforeFilter
# Nov 23rd 2017, 11:20 birdy247 So its
# Nov 23rd 2017, 11:20 neon1024 `thus is fired in the same cycle as all Controller::beforeFilter events.`
# Nov 23rd 2017, 11:20 neon1024 Read the docs you linked @birdy247
# Nov 23rd 2017, 11:14 acosonic is there some webmail client like rainloop, written in cakephp ?
# Nov 23rd 2017, 11:11 dereuromark Maybe you have some custom widgets and database types in place?
# Nov 23rd 2017, 11:11 dereuromark @lorenzo Do we have a proper solution around datetime inputs yet and timezone awareness, as well as dropdown vs input support? I am fighting here with this for months, and there is no real good solution yet.
# Nov 23rd 2017, 11:09 birdy247 I wasnt sure how else the marshaler would get it
# Nov 23rd 2017, 11:09 birdy247 just make it date.timezone ad date.date ?