Giter Site home page Giter Site logo

oc-client-php's Introduction

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

oc-client-php's People

Contributors

matteofigus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oc-client-php's Issues

Improve error handling

Right now, if you try to select a non-existent widget from the registry, the client will fail crashing in ComponentDataRetriever.php@43.

We should handle errors somehow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.