ByteNirvana
ByteNirvana

Reputation: 5700

How can I call the 'log()' method from the beforeSave() method in a model in CakePHP?

How can I call the log() function inside the model beforeSave() function?

All three variants I used didn't work:

function beforeSave() {
#...
Debugger::log($y.' '.$ty);
log('test');
$this->log('testmodel');
}

Upvotes: 1

Views: 671

Answers (1)

ByteNirvana
ByteNirvana

Reputation: 5700

Ah! My model was named wrong and it never got called. This works flawlessly:

$this->log($test);

Upvotes: 1

Related Questions