Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Update observers-bp.md #1700

Merged
merged 2 commits into from
Feb 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ Your observer should not contain logic other than what is needed for it to run.

#### Declare observer in the appropriate scope

Make your observer as specific as it needs to be. This means that if your observer is only concerned with front end events, you should declare your observer in the `<module-dir>/etc/frontend/events.xml` file instead of the global `<module-dir>/etc/events.xml` file.
Make your observer as specific as it needs to be. Declare your observer in the appropriate scope:

* For frontend events, declare observers in `<module-dir>/etc/frontend/events.xml`
* For backend events, declare observers in `<module-dir>/etc/adminhtml/events.xml`

Use the global `<module-dir>/etc/events.xml` file only when an event can occur on both the frontend and the backend.

#### Avoid cyclical event loops

Expand Down