Skip to content

PHP Library of helpers and classes to build out a backend for HAX.

License

Notifications You must be signed in to change notification settings

elmsln/hax_php_lib

Repository files navigation

HAX and Web components PHP Library

Install

Get polymer cli installed prior to usage of this (and (yarn)[https://yarnpkg.com/lang/en/docs/install/#mac-stable] / an npm client of some kind)

$ yarn global add polymer-cli
# or...
$ npm install -g polymer-cli

Then clean up the asset list you actually want to use in production. A large list has been added to this repo for you in build.js.

HAXService

This is a series of helpers for integrating HAX with PHP based systems. Specifically, this helps in getting the HAX Appstore specification output. Appstore is a JSON blob which expresses to HAX how to connect to various services. This helps with integrating with PHP based backends so they can serve up API keys as well as extend what comes across.

WebComponentsService

WebComponentsService also helps get the polyfill applied in a uniform way

// require the service
require WebComponentsService.php;
$WCService = new WebComponentsService();
// return a string to your template / front end some how while passing in
// the path to where the component build directory has been placed.
return $WCService->applyWebcomponents('location/of/your/components/');

In Drupal this looks like $WCService->applyWebcomponents("sites/all/libraries/webcomponents");

You can see this library implemented with some additional customizations in the following frameworks:

About

PHP Library of helpers and classes to build out a backend for HAX.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published