Skip to content

Commit

Permalink
Merge pull request cakephp#2460 from ptica/patch-1
Browse files Browse the repository at this point in the history
Update events.rst
  • Loading branch information
markstory committed Feb 27, 2015
2 parents 97c7ac8 + 146f4e7 commit ab3d768
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions en/core-libraries/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ necessary. Our ``UserStatistics`` listener might start out like::
}
}

// In a controller or somewhere else where $this->Order is accessible
// Attach the UserStatistic object to the Order's event manager
$statistics = new UserStatistic();
$this->Order->getEventManager()->attach($statistics);
Expand Down

0 comments on commit ab3d768

Please sign in to comment.