PHP code example of elephfront / robo-live-reload

1. Go to this page and download the library: Download elephfront/robo-live-reload 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/ */

    

elephfront / robo-live-reload example snippets


use Elephfront\RoboLiveReload\Task\Loader\LoadLiveReloadTaskTrait;

class RoboFile extends Tasks
{

    use LoadLiveReloadTaskTrait;
    
    public function someTask()
    {
        $this
            ->taskLiveReload()
            ->run();
    }
}

use Elephfront\RoboLiveReload\Task\Loader\LoadLiveReloadTaskTrait;

class RoboFile extends Tasks
{

    use LoadLiveReloadTaskTrait;
    
    public function someTask()
    {
        $this
            ->taskLiveReload()
            ->run();
            
        // Further down...
        $this
            ->taskLiveReload()
            ->sendReloadMessage();
    }
}

use Elephfront\RoboLiveReload\Task\Loader\LoadLiveReloadTaskTrait;

class RoboFile extends Tasks
{

    use LoadLiveReloadTaskTrait;
    
    public function someTask()
    {
        $this
            ->taskLiveReload()
            ->run();
            
        // Further down...
        $this
            ->taskLiveReload()
            ->getWsClient()
            ->send('your-message');
    }
}