PHP code example of owlycode / reactboard

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

    

owlycode / reactboard example snippets


$kernel->link(new ExternalAsset(__DIR__ . '/Resources', 'css/your-theme-file.css'));


// src/MyNamespace/MyAppName/MyAppNameApplication.php

namespace MyNamespace\MyAppName;

use OwlyCode\ReactBoard\Application\AbstractApplication;
use OwlyCode\ReactBoard\Application\ApplicationInterface;

class MyAppNameApplication extends AbstractApplication implements ApplicationInterface
{
    /**
     * Called just before the socket server starts.
     */
    public function init()
    {
        $this->watch('my_app_name.request.index', function(){
            return $this->render('index.html.twig', array('status' => 'loaded'));
        });
    }

    public function getName()
    {
        return 'my_app_name';
    }
}

$kernel->register(new MyAppNameApplication());
bash
composer install
cp vendor/owlycode/reactboard/app . -r
mv app/app.php.dist app/app.php