Skip to content

Commit aa1c284

Browse files
committed
add templateParser cmd
1 parent cdab6aa commit aa1c284

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Ubiquity/devtools/cmd/Command.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,20 @@ public static function migrations() {
789789
], 'models');
790790
}
791791

792+
public static function templateParser(){
793+
return new Command("template-parse", "", "Parse a twig template to another template engine.", [
794+
'template_parse',
795+
'template:parse',
796+
'template-parse'
797+
], [
798+
"e" => Parameter::create("engine", "The destination template engine.", [], 'latte'),
799+
"d" => Parameter::create("destination", "The destination folder.", [], 'default view folder'),
800+
'o' => Parameter::create('origin', 'The folder where the templates are located.', [], 'default view folder')
801+
], [
802+
'Migrate all templates in view folder to Latte template engine' => 'Ubiquity template-parse'
803+
], 'views');
804+
}
805+
792806
protected static function getCustomCommandInfos() {
793807
$result = [];
794808
$commands = self::getCustomCommands();
@@ -903,6 +917,7 @@ public static function getCommands() {
903917
self::displayAcls(),
904918
self::newEncryptionKey(),
905919
self::newDomain(),
920+
self::templateParser(),
906921
...self::getCustomCommandInfos()
907922
];
908923
}

0 commit comments

Comments
 (0)