Skip to content

Instantly share code, notes, and snippets.

@LubosRemplik
Created February 14, 2018 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LubosRemplik/0d82f7cfbb0eabd4751f22ac2a6648c9 to your computer and use it in GitHub Desktop.
Save LubosRemplik/0d82f7cfbb0eabd4751f22ac2a6648c9 to your computer and use it in GitHub Desktop.
Crud associated data
public function edit($id)
{
$this->Crud->on('beforeFind', function(\Cake\Event\Event $event) {
$event->getSubject()->query->contain(['Roles']);
});
$this->Crud->execute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment