Nfy module

Notifications system.



In this demo every registered user is subsribed to a default channel.

Notifications are added to this channel by pressing a button.

Demo configuration

        // ...

Long polling is disabled here because it seems this shared hosting platform allows only one process to serve this site.


Applied migrations from the extension.

Created one migration to create the default channel and subscribe existing users to it.

Custom classes

No custom classes are necessary, the NfyDbRoute class is used to deliver messages.

The User class contains code in the afterSave() method to subsribe users to the default channel:

protected function afterSave() {
        foreach(NfyChannels::model()->findAll() as $channel) {
            $channel->subscribe($this->id, 'db');