Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

exp:exptemplateconverttwigtotpl

Convert the Twig templates (.twig) of a design to Exponential templates (.tpl); --dry-run, --file, --force, --override-ini.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/exptemplateconverttwigtotpl.md

On this page

exp:exptemplateconverttwigtotpl

Convert the Twig templates (.twig) of a design to Exponential templates (.tpl); --dry-run, --file, --force, --override-ini.

Script bin/php/exptemplateconverttwigtotpl.php, code in kernel/private/classes/commands/exptemplateconverttwigtotpl.php. Run it from the installation root, as the user the web server runs as:

./console exp:exptemplateconverttwigtotpl --help
./console exp:template:convert:twig-to-tpl --help
php bin/php/exptemplateconverttwigtotpl.php --help

Help text

Convert Twig templates (.twig) to Exponential templates (.tpl)
Every *.twig below --from becomes the *.tpl at the same place below --to (templates/ and
override/templates/ alike), so that it prints what the .twig printed.
A .html.twig is read as the template of its name without .html (x.html.twig -> x.tpl).
--override-ini writes the override rules that make the -s siteaccess use the .tpl.
The same as exp:template:convert --from-engine=twig --to-engine=tpl.

./console exp:template:convert:twig-to-tpl --from=extension/<ext>/design/<design> --to=var/tmp/<design>
./console exp:template:convert:twig-to-tpl --from=extension/<ext>/design/<design> --dry-run
./console exp:template:convert:twig-to-tpl --file=design/<design>/templates/<name>.twig
./console exp:template:convert:twig-to-tpl -s <siteaccess> --from=<design> --to=<design> --override-ini=<file>

Every written file ends with a marker comment ({* exp:template:convert twig->tpl md5:... from ... *});
a target that has no marker, or was changed after it was written, is skipped (SKIP) unless --force
is given. The result is checked before it is written: a .tpl must parse in the template
system's parser. Prints WRITE or REPLACE for every file written, NOTE for every construct that could not
be converted exactly, ERROR for a template that could not be converted, then PASS or FAIL with the counts.
Exit code: 0 PASS; 1 FAIL (a template could not be read, converted, checked or written); 2 wrong options;
3 the conversion is not available (the engine's library or converter is missing).

Options

OptionValueHelp
--fromrequireddesign directory with the .twig templates (every .twig below it is converted)
--torequireddesign directory for the .tpl templates (default: the --from directory, next to the sources)
--filerequiredconvert this one .twig only (below --from, or a file of its own: then --to is the target file)
--override-inirequiredoverride.ini.append.php to write for the --to design (the -s siteaccess's override rules, MatchFile pointing at the converted .tpl)
--dry-runshow what would be written; nothing is written
--forcealso replace a .tpl that was changed or written by hand (no marker, or not matching it)

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/exptemplateconverttwigtotpl.php, kernel/private/classes/commands/exptemplateconverttwigtotpl.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x