elmsln/hax_php_lib

HAX php library of helper classes for serving appstore spec and integrations with web components

0.11.0 2019-08-09 15:05 UTC

This package is auto-updated.

Last update: 2024-05-10 00:58:19 UTC


README

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: