2017 © Pedro Peláez
 

library diversity-php

Engine for generic HTML components

image

diversity_templating/diversity-php

Engine for generic HTML components

  • Thursday, May 4, 2017
  • by fiddur
  • Repository
  • 2 Watchers
  • 0 Stars
  • 2,741 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 9 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Diversity engine in PHP

Build Status Coverage Status, (*1)

A PHP engine for Diversity components, by Textalk., (*2)

Diversity components search engine optimized (SEO) web components, specified by mustache templates, supporting dependencies, backend fetching of data over JSON-RPC, supporting AngularJS templating on the frontend (by doing collected manual bootstrapping)., (*3)

This component system is constructed for use with Textalk Webshop, but is in no way limited to that use., (*4)

Using

  1. Add composer dependency: "diversity_templating/diversity-php": "1.0", (*5)

  2. "Use" it:, (*6)

use Diversity\Factory\Api;
use Diversity\Collection;
use SAI\System\Curl;
  1. Add a component to your page:
$curl = new Curl;
$factory = new Api('https://api.diversity.io/', $curl);
$component = $factory->get('test', '1.2.3');

echo $component->render();
  1. Use a Collection to handle script loading:
$curl = new SAI\System\Curl;
$factory = new Api('https://api.diversity.io/', $curl);
$collection = new Collection;
$collection->add($component = $factory->get('test', '1.2.3'));

?>
<head>
   if ($collection->needsAngular()) {?>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.min.js"></script>
   } ?>
  = $collection->renderScriptTags() ?>
  = $collection->renderStyleTags() ?>
</head>
<body>
  = $component->render() ?>
  = $collection->renderAngularBootstrap() ?>
</body>

Developer install

Development depends on php, php-curl and php-xdebug., (*7)

# Will get composer, install dependencies and run tests
make test

Changelog

1.0.0, (*8)

  • Using php-SAI 1.0.0.

0.3.0, (*9)

  • Factories are refactored; now you are supposed to instantiate a Factory-subclass, not Diversity\Factory directly.

0.2.0, (*10)

  • Handling arrays of styles.

License (MIT)

Copyright (C) 2014, 2015 Textalk AB fredrik.liljegren@textalk.se, (*11)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*12)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*13)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*14)

See COPYING., (*15)

The Versions

04/05 2017

dev-master

9999999-dev

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

04/05 2017

1.0.4

1.0.4.0

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

03/05 2017

dev-proper-order

dev-proper-order

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

07/09 2016

1.0.3

1.0.3.0

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

12/05 2016

1.0.2

1.0.2.0

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

21/05 2015

1.0.1

1.0.1.0

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

12/05 2015

dev-lasso-patch-1

dev-lasso-patch-1

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

11/05 2015

1.0.0

1.0.0.0

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

13/04 2015

dev-devEngine

dev-devEngine

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

18/03 2015

0.3.0

0.3.0.0

Engine for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

01/03 2015

dev-better_error_handling

dev-better_error_handling

Motor for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren

14/11 2014

0.2.0

0.2.0.0

Motor for generic HTML components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fredrik Liljegren