PHP code example of pureware / template-generator
1. Go to this page and download the library: Download pureware/template-generator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pureware / template-generator example snippets
$parser = new Pureware\TemplateGenerator\Parser\TwigParser();
$parser->setTemplateData(
[
'data' => 'value',
]
);
$treeBuilder = new Pureware\TemplateGenerator\TreeBuilder\TreeBuilder();
$treeBuilder->skip(['path/to/file/or/dirrectory']); //skip file or dir
$files = $treeBuilder->buildTree('../templates', 'YourNewDirectory'); // your templates