PHP code example of wyrihaximus / ratchet-model-push

1. Go to this page and download the library: Download wyrihaximus/ratchet-model-push library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wyrihaximus / ratchet-model-push example snippets




class Model extends AppModel {
    public $actsAs = array(
        'RatchetModelPush.Pushable' => array(
            'events' => array(
                array(
                    'eventName' => 'WyriProject.created',
                    'created' => true,
                ),
                array(
                    'eventName' => 'WyriProject.updated',
                    'created' => false,
                ),
                array(
                    'eventName' => 'WyriProject.updated.{id}',
                    'created' => false,
                    'fields' => true,
                ),
            ),
        ), 
    );
}

echo $this->Html->script(array(
    'Ratchet.when/when',
    'Ratchet.autobahn/autobahn',
    'Ratchet.cake-wamp'
));