We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What about adding twig:debug command which displays information about registered extensions, globals, functions, variables, etc..
like this
protected function execute(InputInterface $input, OutputInterface $output) { $twig = $this->getContainer()->get('twig'); $output->writeln('<info>Extensions</info>'); foreach ($twig->getExtensions() as $extension) { $output->writeln(sprintf(' %-30s: %s', $extension->getName(), get_class($extension))); } if ($twig->getGlobals()) { $output->writeln(''); $output->writeln('<info>Globals</info>'); foreach ($twig->getGlobals() as $key => $value) { $output->writeln(sprintf(' %s', $key)); } } if ($twig->getFunctions()) { $output->writeln(''); $output->writeln('<info>Functions</info>'); foreach ($twig->getFunctions() as $name => $function) { if ($function instanceof \Twig_SimpleFunction) { $name = $function->getName(); } $output->writeln(sprintf(' %s', $name)); } } if ($twig->getFilters()) { $output->writeln(''); $output->writeln('<info>Filters</info>'); foreach ($twig->getFilters() as $name => $filter) { if ($filter instanceof \Twig_SimpleFilter) { $name = $filter->getName(); } $output->writeln(sprintf(' %s', $name)); } } }
The text was updated successfully, but these errors were encountered:
#9818
Sorry, something went wrong.
No branches or pull requests
What about adding twig:debug command which displays information about registered extensions, globals, functions, variables, etc..
like this
The text was updated successfully, but these errors were encountered: