Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.39 KB

README.md

File metadata and controls

56 lines (42 loc) · 1.39 KB

oc-client-php

Build status Code coverage

PHP client for OpenComponents

For a nodejs implementation check this link. This library is heavily based on it.

Install

composer require opencomponents/oc-client-php

Quickstart

use OpenComponents\Client;

// Initializing the client
$client = new Client(array(
    "serverRendering" => 'https://your-components.repository.com/'
));

// Render some component
$components = $client->renderComponents(array(
    array(
        'name' => 'your-amazing-widget',
        'parameters' => array(
            'param1' => 'hello opencomponents!',
            'param2' => 'just show me the component'
        )
    ),
    array(
        'name' => 'one-more-component'
    )
));

// Print the rendered component and volià
echo $components['html'];

Running tests

composer test