heydon/robo-twig

Allow the processing of templates via robo

Maintainers

Details

github.com/gheydon/robo-twig

Source

Installs: 29 008

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-12-10 07:48:17 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();