2017 © Pedro Pelรกez
 

library ecl-twig-loader

Europa Component Library Twig loader.

image

ec-europa/ecl-twig-loader

Europa Component Library Twig loader.

  • Tuesday, February 20, 2018
  • by ec-europa
  • Repository
  • 11 Watchers
  • 0 Stars
  • 297 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Europa Component Library Twig loader

Build Status Packagist, (*1)

Twig loader for Europa Component Library Twig implementation (ECL Twig), it allows to load components by accessing them via a configurable namespace., (*2)

For example, given you have the following ECL twig components:, (*3)

/path/to/components/
โ”œโ”€โ”€ ec-component-link
โ”‚ย ย  โ””โ”€โ”€ ecl-link.html.twig
โ””โ”€โ”€ ec-component-language-list
 ย ย  โ”œโ”€โ”€ ecl-language-list.html.twig
 ย ย  โ”œโ”€โ”€ ecl-language-list-item.html.twig
 ย ย  โ”œโ”€โ”€ ecl-language-list-overlay.html.twig
 ย ย  โ””โ”€โ”€ ecl-language-list-splash.html.twig

If you setup the loader as follows:, (*4)

<?php

use \OpenEuropa\Twig\Loader\EuropaComponentLibraryLoader;

$loader = new EuropaComponentLibraryLoader(['ecl-twig'], '/components', '/path/to');
$twig = new Twig_Environment($loader);

Then you can load the link component in the following way:, (*5)

{% include '@ecl-twig/ec-component-link/ecl-link.html.twig' with {
  link: { 
    type: 'standalone',
    label: 'Standalone link',
    path: 'http://google.com',
    icon_position: 'after'
  }
} %}

You can also use a shorter form, based on implicit naming conventions:, (*6)

{% include '@ecl-twig/link' with {
  link: {
    type: 'standalone',
    label: 'Standalone link',
    path: 'http://google.com',
    icon_position: 'after'
  }
} %}

To load sub-components append them after the component name:, (*7)

{% include '@ecl-twig/language-list/language-list-splash' %}

Installation using Docker Compose

The setup procedure can be simplified by using Docker Compose., (*8)

Requirements:, (*9)

Copy docker-compose.yml.dist into docker-compose.yml., (*10)

You can make any alterations you need for your local Docker setup. However, the defaults should be enough to set the project up., (*11)

Run:, (*12)

$ docker-compose up -d

Then:, (*13)

$ docker-compose exec web composer install

The Versions

20/02 2018

dev-master

9999999-dev

Europa Component Library Twig loader.

  Sources   Download

EUPL-1.1

The Requires

 

The Development Requires

20/02 2018

dev-OPENEUROPA-197

dev-OPENEUROPA-197

Europa Component Library Twig loader.

  Sources   Download

EUPL-1.1

The Requires

 

The Development Requires

19/05 2017

0.0.1

0.0.1.0

Europa Component Library Twig loader.

  Sources   Download

EUPL-1.1

The Requires

 

The Development Requires