opencomponents/oc-client-php

oc-client PHP 实现版本

0.0.1 2017-07-15 19:40 UTC

This package is not auto-updated.

Last update: 2024-09-15 02:04:02 UTC


README

Build status Code coverage

OpenComponents 的 PHP 客户端 OpenComponents

对于 Node.js 实现请查看此 链接。此库在很大程度上基于它。

安装

composer require opencomponents/oc-client-php

快速开始

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'];

运行测试

composer test