Activities
Activity instances are created for special events in the context of a humhub\modules\content\models\ContentContainer|ContentContainer
like the creation of content.
Contrary to notifications - activities are always bound to a humhub\modules\content\models\ContentContainer|ContentContainer
, and are not targeted for specific users.
Besides the relation to the ContentContainer
- an activity can also be assigned with a Content or ContentAddon and automatically inherits some content properties such as visibility
.
Similar to notifications activities can be related to an originator
user and a source
object.
The activity will adopt some properties as the visibility
in cas of Content
or ContentAddon
sources.
Implement a Custom Activity
Create Class & View
Your custom activites should reside in your modules activities
directory.
Example activity:
By default activity views should be located inside a activities/views
directory (e.g. mymodule/activities/views/
).
Example view file somethingHappend.php:
If you require a different view for mails, you have to add a view with the same view name to the activities/views/mail
directory.