heydon/robo-twig

Allow the processing of templates via robo

Maintainers

Details

github.com/gheydon/robo-twig

Source

Installs: 6 734

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:robo-tasks

dev-master 2018-06-20 06:11 UTC

This package is auto-updated.

Last update: 2020-06-17 06:21:24 UTC


README

Use twig as a templating system system for robo

Usage

  • Use with template in memory, and displaying to the screen
    $this->taskTwig()
      ->setTemplatesArray('index', 'Hello {{ name }}!')
      ->setContext('name', 'Fabien')
      ->applyTemplate('index', '')
      ->run();
  • Use with template file and write to destination
    $this->taskTwig()
      ->setTemplatesDirectory('./templates')
      ->setContext('name', 'Fabien')
      ->applyTemplate('index.twig', 'index.txt')
      ->applyTemplate('index.html.twig', 'index.html')
      ->run();