# |
Jul 20th 2017, 09:57 |
rogerpro |
If `$ bin/cake migrations status` says ```up 20170719154742 Foo ** MISSING **``` how can I remove this 20170719154742 ? is it on the cache? I deleted the file while testing but it remains something somewhere… :thinking_face: |
# |
Jul 20th 2017, 09:55 |
ldsign |
Hi. Is it possible to render the (viewClass) layout, but not the (method-specific) template? |
# |
Jul 20th 2017, 09:54 |
ZoeB |
Thank you very much! |
# |
Jul 20th 2017, 09:54 |
ZoeB |
Thanks, that's working! 'id' => 'BarFake', 'name' => 'data[Bar][fake]', |
# |
Jul 20th 2017, 09:52 |
hmic |
i actually thought cake would *not* add the current scopes alias to a qualified form field (this is Bar.fake instead of fake)... I might be wrong |
# |
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 |