dev-master
9999999-devExpands on robo-twig to add additional support for blt
GPL-2.0-or-later
The Requires
Expands on robo-twig to add additional support for blt
Twig is such a powerful templating language and the built in replace command in robo completely inadiquate. Tasks such as building a default settings.php for Drupal where you take many different variables from the blt config yaml file can very challenging., (*1)
$this->taskReplaceInFile('box/robo.txt') ->from( [ '##dbname##', '##dbhost##' ]) ->to( [ $this->getConfigValue('drupal.db.database'), $this->getConfigValue('drupal.db.host') ]) ->run();
Compared to twig, (*2)
$this->taskTwig($this) ->setTemplatesDirectory($this->getConfigValue('repo.root') . '/blt/Templates') ->applyTemplate('settings.php.twig', $this->getConfigValue('drupal.settings_file')) ->applyTemplate('sites.php.twig', $this->getConfigValue('docroot') . '/sites') ->run();
Using the template which is provided., (*3)
$databases['default']['default'] = array ( 'database' => '{{ config.drupal.db.database }}', 'username' => '{{ config.drupal.db.username }}', 'password' => '{{ config.drupal.db.password }}', 'prefix' => '', 'host' => '{{ config.drupal.db.host }}', 'port' => '{{ config.drupal.db.port }}', 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', 'driver' => 'mysql', );
The task and config variables are automatically exposed during the ::twigTask(), so your templates have full access to every config variable while it is being generated., (*4)
Expands on robo-twig to add additional support for blt
GPL-2.0-or-later