Log message #4054472

# At Username Text
# Jul 20th 2017, 09:51 hmic ZoeB, you can provide the name in the options array if cakes guess iss wrong
# Jul 20th 2017, 09:50 ZoeB I realise I could just call it $this->Form->input('Foo.fake_column'), but that's semantically less accurate. Is there some kind of $this->Form->input('Misc.fake_column') I should be using for form inputs that don't correspond directly to what's in the database?
# Jul 20th 2017, 09:44 josexato Ok I understand
# Jul 20th 2017, 09:44 dereuromark the main idea of the plugin is to have the same code in actions for both ajax and non ajax, so you basically get some ajax on top for free. in that light @hmic approach is usually overkill ;) If you just need a few small ajax enhancements here and there
# Jul 20th 2017, 09:43 hmic angular(1/2/4) is the prime example(s) i think.
# Jul 20th 2017, 09:43 ZoeB Hi! I'm (belatedly) upgrading from 1.3 to 2.0. Regarding the form helper, $this->Form->input('Foo.real_column') works, and $this->Form->input('Bar.real_column') works, but $this->Form->input('Bar.fake_column') gets rendered as Foo.Bar.fake_column. Is there a way around this?
# Jul 20th 2017, 09:43 hmic so you do need to work in a javascript environment too, to which cake often times is completely external, just providing data through an api
# Jul 20th 2017, 09:43 saeideng see different with and without plugin
# Jul 20th 2017, 09:42 josexato thanks
# Jul 20th 2017, 09:42 josexato @saeideng I'll test it now
# Jul 20th 2017, 09:42 hmic but todays frontends are heavy on javascript
# Jul 20th 2017, 09:42 saeideng http://sandbox.dereuromark.de/sandbox/ajax-examples
# Jul 20th 2017, 09:42 josexato @neon1024 thanks
# Jul 20th 2017, 09:41 hmic depends on what you do
# Jul 20th 2017, 09:41 josexato from that point*
# Jul 20th 2017, 09:41 josexato @hmic from point, do you think that using the views and templates in cake are not the best option to lauch a platform to the public?
# Jul 20th 2017, 09:39 saeideng but you no force to using this plugin
# Jul 20th 2017, 09:39 saeideng and is very useful
# Jul 20th 2017, 09:39 saeideng even that sent to you redirect url for especial usage
# Jul 20th 2017, 09:38 saeideng this pluggin separate response content and error message
# Jul 20th 2017, 09:37 saeideng i personally use dereuromark ajax plugin
# Jul 20th 2017, 09:35 hmic use a frontend framework and an api to get your data :p
# Jul 20th 2017, 09:35 hmic ajax is so 2000...
# Jul 20th 2017, 09:35 saeideng ``` $.ajax({ type: 'get', url: '?php echo $this->Html->url(['action' => 'favorites']); ?', success: function(response) { $('#target').html(response); }, error: function(e) { console.log(e); } }); ```
# Jul 20th 2017, 09:34 neon1024 If you want a super basic introduction, https://www.w3schools.com/xml/ajax_intro.asp
# Jul 20th 2017, 09:33 saeideng cake 3 have not helper for this
# Jul 20th 2017, 09:32 saeideng you just need js to send ajax request
# Jul 20th 2017, 09:32 josexato thanks, the views documentations is what is a bit fuzzy, I am still trying to undestand it better
# Jul 20th 2017, 09:30 saeideng in controller area
# Jul 20th 2017, 09:30 saeideng but you can detect it by `$this->request->is('ajax')`
# Jul 20th 2017, 09:29 saeideng ajax and normal request is equal
# Jul 20th 2017, 09:28 josexato thank, I am using cake 3 but i'll read to understand the aproach
# Jul 20th 2017, 09:28 neon1024 http://sandbox.dereuromark.de/sandbox/jquery-examples> => <https://github.com/dereuromark/cakephp-sandbox/tree/3.0/plugins/Sandbox/src/Template/AjaxExamples
# Jul 20th 2017, 09:28 saeideng ajax is very simple in cakephp3
# Jul 20th 2017, 09:28 saeideng but is useful to reading it
# Jul 20th 2017, 09:27 saeideng this used a plugin on cake2
# Jul 20th 2017, 09:27 saeideng http://www.dereuromark.de/2014/01/09/ajax-and-cakephp/
# Jul 20th 2017, 09:24 josexato Hello, I am looking to do a view that updates by it self, I think this is ajax, I've search for this in the cookbook but did not find anything explicit in how to implement an ajax view. can you please recomend me some tutorial?
# Jul 20th 2017, 09:19 saeideng good morning
# Jul 20th 2017, 09:17 lorenzo good morning :slightly_smiling_face:
# Jul 20th 2017, 09:17 lorenzo hehe