PHP code example of ivanvoitovych / fluffy

1. Go to this page and download the library: Download ivanvoitovych/fluffy 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/ */

    

ivanvoitovych / fluffy example snippets


CronTab::schedule([TestTask::class, 'execute'], '*/5 * * * * *');

Hubs::mapHub('collect', [CollectHub::class, 'collect']);



namespace Application\Hubs;

use Application\Models\CollectModel;

class CollectHub
{
    public function collect(CollectModel $message, $data, string $name)
    {
        print_r(['CollectHub::collect', $message->date, $data, $name]);
    }
}



namespace Application\Controllers;

use Fluffy\Controllers\BaseController;

class TestController extends BaseController
{
}