Converting the template from tpl to twig is somewhat easy to do.
Download "php2twig" slightly modified (click here), on the fly, to have a working recursive file conversion (recursive glob function from php.net comments).
The original source code can be found here: https://github.com/makinacorpus/php-twig-converter
Copy php2twig in your theme folder (suggested).
Go in your theme folder and run the following command:
(windows)
php.exe php2twig -e .tpl -ne .twig -r "c:/fullpath/to/template"
(linux)
./php2twig -e .tpl -ne .twig -r /fullpath/to/template
Save the output of php2twig to verify eventual problems.
For sure the bulk work is mostly done by this useful script
Note: the script doesn't convert correctly the {% endfor %}.
Download "php2twig" slightly modified (click here), on the fly, to have a working recursive file conversion (recursive glob function from php.net comments).
The original source code can be found here: https://github.com/makinacorpus/php-twig-converter
Copy php2twig in your theme folder (suggested).
Go in your theme folder and run the following command:
(windows)
php.exe php2twig -e .tpl -ne .twig -r "c:/fullpath/to/template"
(linux)
./php2twig -e .tpl -ne .twig -r /fullpath/to/template
Save the output of php2twig to verify eventual problems.
For sure the bulk work is mostly done by this useful script
Note: the script doesn't convert correctly the {% endfor %}.
Comments
Post a Comment