Jump to main content Jump to doc navigation

modX::addEventListener

Add a plugin to the eventMap within the current execution cycle.

Syntax

API Doc: modX::addEventListener()

boolean addEventListener (string $event, integer $pluginId, [string $propertySetName = ''])
  • $event (string) Name of the event. required
  • $pluginId (integer) Plugin identifier to add to the event. required
  • $propertySetName (string) The name of property set bound to the plugin

Example

Add a Plugin with ID 2 to the Event OnChunkPrerender:

$modx->addEventListener('OnChunkPrerender', 12);

See Also

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Dannevang Digital
  • Sepia River Studios
  • Chris Fickling
  • CrewMark
  • deJaya
  • eydolan
  • Following Sea
  • Lefthandmedia
  • Murray Wood
  • Anton Tarasov
  • Stéphane Jäggi
  • Raffy
  • Snow Creative
  • Nick Clark
  • A. Moreno
  • JT Skaggs
  • Helen
  • YJ
  • krisznet
  • Richard
  • Yanni

Budget

$311 per month—let's make that $500!

Learn more