PHP code example of eos / com-view-server

1. Go to this page and download the library: Download eos/com-view-server 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/ */

    

eos / com-view-server example snippets


 
 $view = new Eos\ComView\Server\View\ViewRegistry();
 $view->add('test', new Your\View());

 $commandProcessor = new Eos\ComView\Server\Command\CommandProcessorRegistry();
 $commandProcessor->add('test', new Your\Command());
 
 $healthProvider = new Eos\ComView\Server\Health\HealthProviderChain();
 
 $server = new Eos\ComView\Server\ComViewServer($commandProcessor, $view, $healthProvider, $healthProvider);
 


 $response = $server->view('viewName', $headers, $queryParameters);
 


 $response = $server->execute($headers, $requestBody);



 $response = $server->health();