How do I call the doSomethingElse function from within this anonymous function?
If I try $this->doSomethingElse() I get 'Using $this when not in object context ' error
class MyController extends AppController {
public function doSomethingElse()
{
//do something
}
public function doSomething()
{
$this->Crud->on('afterSave', function(CakeEvent $event) {
if ($event->subject->success) {
//how do I call 'doSomethingElse' from here
}
});
}
}