# |
Dec 27th 2018, 10:36 |
doomsday_ |
I know CodeIgniter and looking to learn CakePHP |
# |
Dec 27th 2018, 10:36 |
challgren |
Hi CakePHP newbie |
# |
Dec 27th 2018, 10:35 |
doomsday_ |
Hello, CakePHP newbie here |
# |
Dec 27th 2018, 09:42 |
challgren |
No worries good luck! |
# |
Dec 27th 2018, 09:42 |
chan |
@challgren oh.. now, i understand your explain. code is working now. thanks you. |
# |
Dec 27th 2018, 09:32 |
challgren |
After your `$this->ModelName->save($data);` |
# |
Dec 27th 2018, 09:30 |
challgren |
@chan use `$last_id = $this->ModelName->id` |
# |
Dec 27th 2018, 09:28 |
yamcomnet |
thats clear! Thanks @challgren |
# |
Dec 27th 2018, 09:28 |
challgren |
https://book.cakephp.org/3.0/en/plugins.html#loading-a-plugin |
# |
Dec 27th 2018, 09:27 |
challgren |
Yes |
# |
Dec 27th 2018, 09:27 |
challgren |
https://github.com/cakephp/app/blob/master/src/Application.php#L47 |
# |
Dec 27th 2018, 09:27 |
yamcomnet |
load all plugins there? |
# |
Dec 27th 2018, 09:26 |
challgren |
Under your `public function bootstrap()` |
# |
Dec 27th 2018, 09:26 |
challgren |
@yamcomnet You would put that in your `/src/Application.php` |
# |
Dec 27th 2018, 09:23 |
yamcomnet |
what is the namespace of Application? |
# |
Dec 27th 2018, 09:23 |
yamcomnet |
trying to fix deprecations: Plugin::load() is deprecated. Use Application::addPlugin() |
# |
Dec 27th 2018, 09:23 |
chan |
hi everyone, i want to get last id of table mysql with cakephp 2 coding. i try the following coding, but didn't work. ``` $this->ModelName->id; $record_id=$this->ModelName->getLastInsertID(); ``` so, can you help me to get the last id for table. thanks. |
# |
Dec 27th 2018, 09:15 |
challgren |
test received |
# |
Dec 27th 2018, 09:13 |
savant |
test |
# |
Dec 27th 2018, 09:13 |
savant |
test |
# |
Oct 10th 2018, 01:57 |
blancessanchez30 |
how to do beforefilter before ajax call in cakephp 3 |
# |
Oct 10th 2018, 01:57 |
blancessanchez30 |
good morning |
# |
Oct 9th 2018, 22:17 |
sdevore |
I use ‘hidden’ ;) |
# |
Oct 9th 2018, 22:13 |
rightscoreanalysis |
great thanks, I think it works now |
# |
Oct 9th 2018, 22:11 |
bmudda |
@rightscoreanalysis Yes according to the docs, that's correct. |
# |
Oct 9th 2018, 22:00 |
rightscoreanalysis |
in order to update |
# |
Oct 9th 2018, 22:00 |
rightscoreanalysis |
@bmudda so if Tags is my hasMany data do I need: echo $this->Form->control('tags.0.id'); |
# |
Oct 9th 2018, 21:58 |
bmudda |
https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data |
# |
Oct 9th 2018, 21:58 |
rightscoreanalysis |
is Foo hasMany Bar, do I need to set Bar.id in the request data to update it? |
# |
Oct 9th 2018, 21:54 |
rightscoreanalysis |
is anyone here? |
# |
Oct 9th 2018, 21:51 |
rightscoreanalysis |
which is this happening? This is an update to an existing record |
# |
Oct 9th 2018, 21:50 |
rightscoreanalysis |
if I debug the patch entity i see: '[new]' => true, |
# |
Oct 9th 2018, 21:40 |
rightscoreanalysis |
no matter what it always tries to save new records which is wrong |
# |
Oct 9th 2018, 21:40 |
rightscoreanalysis |
https://gist.github.com/spacebiscuit/59a4ebbade0ea1e96f8b0a5faaf61735 |
# |
Oct 9th 2018, 21:40 |
rightscoreanalysis |
this is totally screwed up and I don't see anything wrong with this request data |
# |
Oct 9th 2018, 21:32 |
rightscoreanalysis |
https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-hasmany-associations |
# |
Oct 9th 2018, 21:32 |
rightscoreanalysis |
the book's example is not in this format.... |
# |
Oct 9th 2018, 21:31 |
rightscoreanalysis |
I thought that hasMany data should be model.0.field |
# |
Oct 9th 2018, 21:22 |
rightscoreanalysis |
Is that enough? |
# |
Oct 9th 2018, 21:21 |
rightscoreanalysis |
$this->Form->input('id', ['type' => 'hidden', 'value' => $periodId]); |
# |
Oct 9th 2018, 21:21 |
rightscoreanalysis |
I am setting the id of the PropertyPeriod |