Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/opencomponents/oc-client-php
PHP client for OpenComponents
https://github.com/opencomponents/oc-client-php
oc-client opencomponents php widgets
Last synced: about 2 months ago
JSON representation
PHP client for OpenComponents
- Host: GitHub
- URL: https://github.com/opencomponents/oc-client-php
- Owner: opencomponents
- License: gpl-3.0
- Created: 2017-05-10T16:32:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-07T18:11:50.000Z (8 months ago)
- Last Synced: 2024-04-14T07:49:32.470Z (3 months ago)
- Topics: oc-client, opencomponents, php, widgets
- Language: PHP
- Homepage:
- Size: 101 KB
- Stars: 6
- Watchers: 10
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-oc - PHP client - php client in github (Clients)
README
# oc-client-php
[![Build status][build svg]][build status]
[![Code coverage][coverage svg]][coverage]PHP client for [OpenComponents][open-components]
For a nodejs implementation check this [link][oc-client-node]. This library is heavily based on it.
## Install
```bash
composer require opencomponents/oc-client-php
```## Quickstart
```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'];
```## Running tests
```bash
composer test
```[open-components]: https://github.com/opentable/oc
[oc-client-node]: https://github.com/opencomponents/oc-client-node
[build status]: https://travis-ci.org/opencomponents/oc-client-php
[build svg]: https://img.shields.io/travis/opencomponents/oc-client-php/master.svg?style=flat-square[coverage]: https://codecov.io/gh/opencomponents/oc-client-php
[coverage svg]: https://img.shields.io/codecov/c/github/opencomponents/oc-client-php/master.svg?style=flat-square