heydon/robo-twig

Allow the processing of templates via robo

Maintainers

Details

github.com/gheydon/robo-twig

Source

Installs: 28 604

Dependents: 2

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Type:robo-tasks

dev-master 2020-12-09 22:49 UTC

This package is auto-updated.

Last update: 2024-04-10 06:35:00 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();