Closed rik43 closed 6 years ago
No problem,
It seems relevant. Will do it soon.
You can now upgrade to 2.5.2 and use $compiler->getFilename()
.
Thanks,
awesome! Thanks!
I re-open to consider how to make this feature compatible with pug-php version 3.
first, check if someone is using it. I, do not use this library now.
Fixed by https://github.com/phug-php/compiler/releases/tag/0.5.15:
This is the new way to get the filename:
public function __invoke($source, $options, Compiler $compiler)
{
$templateFilename = $compiler->getPath();
}
in custom filter we need to get template path. for example, i make include-markdown filter and can support insert by relative paths. or insert images by relative paths. Compiler class contain $filename property, but protected.
example in custom filter usage: