29 $rClass=new \ReflectionClass($this->baseClass);
30 if ($rClass->isAbstract()) {
31 $controllerTemplate =
"authController.tpl";
33 "Ubiquity\\utils\\http\\USession" =>
true,
34 "Ubiquity\\utils\\http\\URequest" => true
36 if($this->baseClass==
'\\Ubiquity\\controllers\\auth\\AuthControllerConfig'){
37 $filename=\lcfirst($this->controllerName);
38 $classContent.=
$scaffoldController->_createMethod(
'protected',
'getConfigFilename',
'',
': string ',
"\t\treturn '$filename';");
39 $completeClassname = $this->controllerNS .
"auth\\".$this->controllerName;
40 if(\method_exists($this->baseClass,
'init')){
41 \call_user_func($this->baseClass.
"::init",$filename);
45 $controllerTemplate =
'authController_.tpl';
49 if (isset($this->views)) {
50 $this->
addViews($messages, $classContent);
56 if ($this->routePath !=
null) {
62 '%route%' => $routeAnnot,
65 '%baseClass%' => $this->baseClass,
66 '%content%' => $classContent
67 ], $controllerTemplate);
68 echo implode(
"\n", $messages);
71 protected function addViews(&$messages, &$classContent) {
74 $authViews = \explode(
',', $this->views);
75 $this->
addUse(
"controllers\\auth\\files\\{$authControllerName}Files");
76 $this->
addUse(
"Ubiquity\\controllers\\auth\\AuthFiles");
77 $classContent .=
$scaffoldController->_createMethod(
'protected',
'getFiles',
'',
': AuthFiles',
"\t\treturn new {$authControllerName}Files();");
78 $classFilesContent = [];
79 foreach ($authViews as $file) {
80 if (isset(ScaffoldController::$views[
'auth'][$file])) {
81 $frameworkViewname = ScaffoldController::$views[
"auth"][$file];
82 $scaffoldController->createAuthCrudView($frameworkViewname, $authControllerName, $file, $this->useViewInheritance);
83 $classFilesContent[] =
$scaffoldController->_createMethod(
'public',
'getView' . \ucfirst($file),
'',
': string',
"\t\treturn \"" . $authControllerName .
"/" . $file .
".html\";");