Skip to content

Commit effd38f

Browse files
committed
fi xroute creation pb with controllers
1 parent e1acba7 commit effd38f

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Ubiquity/scaffolding/ScaffoldController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ public function _createController($controllerName, $variables = [], $ctrlTemplat
9696
$msgView = "<br>The default view associated has been created in <b>" . UFileSystem::cleanPathname(\ROOT . \DS . $viewDir) . "</b>";
9797
$indexContent = "\$this->loadView(\"" . $controllerName . "/index.html\");";
9898
}
99-
$variables = \array_merge($variables, [
99+
$variables = \array_merge([
100100
'%controllerName%' => $controllerName,
101101
'%indexContent%' => $indexContent,
102-
'%namespace%' => $namespace
103-
]);
102+
'%namespace%' => $namespace,
103+
'%route%'=>'',
104+
'%uses%'=>''
105+
],$variables);
104106
UFileSystem::openReplaceWriteFromTemplateFile($templateDir . $ctrlTemplate, $filename, $variables);
105107
$msgContent = "The <b>" . $controllerName . "</b> controller has been created in <b>" . UFileSystem::cleanFilePathname($filename) . "</b>." . $msgView;
106108
if (isset($variables['%routePath%']) && $variables['%routePath%'] !== '') {

src/Ubiquity/scaffolding/templates/aclController.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
%namespace%
33

4+
%uses%
45
use Ubiquity\controllers\Controller;
56
use Ubiquity\security\acl\controllers\AclControllerTrait;
67

@@ -9,7 +10,7 @@ class %controllerName% extends Controller {
910
use AclControllerTrait;
1011
1112
public function index() {
12-
13+
%indexContent%
1314
}
1415

1516
public function _getRole() {

src/Ubiquity/scaffolding/templates/oauthController.tpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
%namespace%
3+
34
%uses%
45
use Hybridauth\Adapter\AdapterInterface;
56
/**
@@ -10,9 +11,7 @@ class %controllerName% extends %baseClass%{
1011
public function index(){
1112
}
1213

13-
/**
14-
* @get("%route%/{name}")
15-
*/
14+
%route%
1615
public function _oauth(string $name):void {
1716
parent::_oauth($name);
1817
}

src/Ubiquity/scaffolding/templates/seoController.tpl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22
%namespace%
33

4+
%uses%
45
use Ubiquity\controllers\seo\SeoController;
56

6-
/**
7-
* SEO Controller %controllerName%
8-
*/
97
class %controllerName% extends SeoController {
108
119
public function __construct(){
@@ -14,9 +12,7 @@ class %controllerName% extends SeoController {
1412
$this->seoTemplateFilename="%sitemapTemplate%";
1513
}
1614

17-
/**
18-
* %route%
19-
*/
15+
%route%
2016
public function index(){
2117
return parent::index();
2218
}

src/Ubiquity/scaffolding/templates/shieldonController.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
namespace controllers;
33

4+
%uses%
5+
46
/**
57
* Controller Shieldon
68
*/

0 commit comments

Comments
 (0)