How to get the id of the current record?

Another CakePHP wireframe issue ...

How can I get the id of the current record?

+3
source share
2 answers

Basically, if you are wondering how to get the record identifier after saving, it is very simple.

if($this->MyModel->save($this->data)){
    //the id is here
    echo $this->MyModel->id;
}

NTN

+36
source

OK, I get it!

it

echo $modelName['ModelName']['id'];

tnx anw!

+1
source

Source: https://habr.com/ru/post/1749619/


All Articles