PHP code example of cvc / twig-documentor
1. Go to this page and download the library: Download cvc/twig-documentor 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/ */
cvc / twig-documentor example snippets
$environment = new \Twig\Environment(new \Twig\Loader\ArrayLoader());
$environmentDescriber = new \Cvc\TwigDocumentor\Describer\EnvironmentDescriber(
new \Cvc\TwigDocumentor\Describer\FunctionDescriber(\phpDocumentor\Reflection\DocBlockFactory::createInstance()),
new \Cvc\TwigDocumentor\Describer\FilterDescriber(\phpDocumentor\Reflection\DocBlockFactory::createInstance())
);
$documentation = $environmentDescriber->describe($environment);
$documentation = $documentation->withSource(__DIR__.'/*');