Skip to content

Commit 42e7743

Browse files
committed
add parseFromTwig
1 parent 8800cc3 commit 42e7743

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Ubiquity/scaffolding/ScaffoldController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function createAuthCrudView($frameworkName, $controllerName, $newName, $u
334334
if (isset($teInstance)) {
335335
if ($useViewInheritance) {
336336
$blocks = $teInstance->getBlockNames($frameworkName);
337-
if (sizeof($blocks) > 0) {
337+
if (count($blocks) > 0) {
338338
$content = [
339339
"{% extends \"" . $frameworkName . "\" %}\n"
340340
];
@@ -358,7 +358,11 @@ public function createAuthCrudView($frameworkName, $controllerName, $newName, $u
358358
];
359359
}
360360
if (isset($content)) {
361-
return UFileSystem::save($folder . \DS . $newName . '.html', implode('', $content));
361+
$strContent=\implode('', $content);
362+
if (\method_exists($teInstance,'parseFromTwig')) {
363+
$strContent=$teInstance->parseFromTwig($strContent);
364+
}
365+
return UFileSystem::save($folder . \DS . $newName . '.html', $strContent);
362366
}
363367
}
364368

0 commit comments

Comments
 (0)