@@ -93,21 +93,29 @@ class: $isAbsolute ? substr($controllerClass, 1) : \sprintf('Controller\%s', $in
93
93
.($ isInvokable ? '.html.twig ' : '/index.html.twig ' )
94
94
;
95
95
96
- $ controllerPath = $ generator ->generateController (
97
- $ controllerClassData ->getFullClassName (),
98
- 'controller/Controller.tpl.php ' ,
99
- [
100
- 'class_data ' => $ controllerClassData ,
101
- // 'use_statements' => $useStatements,
102
- // 'route_path' => Str::asRoutePath($controllerClassNameDetails->getRelativeNameWithoutSuffix()),
103
- 'route_path ' => Str::asRoutePath ($ controllerClassData ->getClassName (relative: true , withoutSuffix: true )),
104
- 'route_name ' => Str::AsRouteName ($ controllerClassData ->getClassName (relative: true , withoutSuffix: true )),
105
- // 'route_name' => Str::asRouteName($controllerClassNameDetails->getRelativeNameWithoutSuffix()),
106
- 'method_name ' => $ isInvokable ? '__invoke ' : 'index ' ,
107
- 'with_template ' => $ withTemplate ,
108
- 'template_name ' => $ templateName ,
109
- ]
110
- );
96
+ $ controllerPath = $ generator ->generateClassFromClassData ($ controllerClassData , 'controller/Controller.tpl.php ' , [
97
+ 'route_path ' => Str::asRoutePath ($ controllerClassData ->getClassName (relative: true , withoutSuffix: true )),
98
+ 'route_name ' => Str::AsRouteName ($ controllerClassData ->getClassName (relative: true , withoutSuffix: true )),
99
+ 'method_name ' => $ isInvokable ? '__invoke ' : 'index ' ,
100
+ 'with_template ' => $ withTemplate ,
101
+ 'template_name ' => $ templateName ,
102
+ ], true );
103
+
104
+ // $controllerPath = $generator->generateController(
105
+ // $controllerClassData->getFullClassName(),
106
+ // 'controller/Controller.tpl.php',
107
+ // [
108
+ // 'class_data' => $controllerClassData,
109
+ // // 'use_statements' => $useStatements,
110
+ // // 'route_path' => Str::asRoutePath($controllerClassNameDetails->getRelativeNameWithoutSuffix()),
111
+ // 'route_path' => Str::asRoutePath($controllerClassData->getClassName(relative: true, withoutSuffix: true)),
112
+ // 'route_name' => Str::AsRouteName($controllerClassData->getClassName(relative: true, withoutSuffix: true)),
113
+ // // 'route_name' => Str::asRouteName($controllerClassNameDetails->getRelativeNameWithoutSuffix()),
114
+ // 'method_name' => $isInvokable ? '__invoke' : 'index',
115
+ // 'with_template' => $withTemplate,
116
+ // 'template_name' => $templateName,
117
+ // ]
118
+ // );
111
119
112
120
if ($ withTemplate ) {
113
121
$ generator ->generateTemplate (
0 commit comments