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/ */
// 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';
}
}