php bin/console lint:twig
Lint a Twig template and outputs encountered errors
Usage
lint:twig [--format FORMAT] [--show-deprecations] [--excludes [EXCLUDES]] [--] [<filename>...]
Arguments
filename A file, a directory or "-" for reading from STDIN
Options
--format The output format ("txt", "json", "github")
--show-deprecations Show deprecations as errors
--excludes Excluded directories
Help
The lint:twig command lints a template and outputs to STDOUT
the first encountered syntax error.
You can validate the syntax of contents passed from STDIN:
cat filename | php bin/console lint:twig -
Or the syntax of a file:
php bin/console lint:twig filename
Or of a whole directory:
php bin/console lint:twig dirname
php bin/console lint:twig dirname --format=json
Or all template files in a bundle:
php bin/console lint:twig @AcmeDemoBundle