River

From Elgg Documentation

Jump to: navigation, search

This page gives an overview of adding adding events to the River in an Elgg plugin. Elgg has native support for a River, a stream of short updates of what you and your friends are up to on your profile.

Events

The key to how the river works is the Elgg events system and the system log. The system log will listen to events and some events pass an object. If the object implements the Loggable interface it will automatically be included in the system log.

View

In order for things to appear in the river you need to provide a view. This view should be /river/CLASSNAME/EVENT, where CLASSNAME is the class you’re interested in and EVENT is the event.

For example, if you want to output create events for all ElggObjects then you would need to create a file called create.php in a directory /river/ElggObject/create.php.

This file will be passed an Elgg River Statement object.

Personal tools