Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Latest commit

 

History

History
27 lines (22 loc) · 1.01 KB

File metadata and controls

27 lines (22 loc) · 1.01 KB

Component.php

Create static html files from Component.io components.
Currently WIP

How-to

  1. Create a new project and associated components on https://component.io
  2. Create a tpl folder in the working directory
  3. Add in your templates with the extension .html.php, each template will be processed and the output written to the dest folder with the .php extension removed
  4. Create a dest folder in the working directory
  5. Run php component.php or HTTP POST to it if running on a web server

Reference

ComponentCls($project, $component)

$project the project id, $component is the component id.

NOTE: At the moment you can only use components from one project.

The resulting object will have the properties of the component

Example

<?php
$thing = \Component\ComponentCls('cio-library', 'errba');
echo $thing->content;

ComponentCls->build_image($img, $tf)

Works the same as the official one, see https://guide.component.io/v1/api/index.html#Component-buildImage-image-options