@@ -37,24 +37,6 @@ public function getOptionsRoute():string
37
37
$ r = explode ('/ ' , $ r );
38
38
array_pop ($ r );
39
39
return implode ('/ ' , $ r ) . '/options ' ;
40
-
41
- // if (!empty($this->prefixSettings)) {
42
- // if (isset($this->prefixSettings['module'])) {
43
- // $prefix = $this->prefixSettings['module'];
44
- // return static::finalOptionsRoute($prefix, $this->controllerId);
45
- // } elseif (isset($this->prefixSettings['namespace']) && str_contains($this->prefixSettings['namespace'], '\modules\\')) { # if `module` not present then check in namespace and then in path
46
- // $prefix = static::computeModule('\\', $this->prefixSettings['namespace']);
47
- // if ($prefix) {
48
- // return static::finalOptionsRoute($prefix, $this->controllerId);
49
- // }
50
- // } elseif (isset($this->prefixSettings['path']) && str_contains($this->prefixSettings['path'], '/modules/')) {
51
- // $prefix = static::computeModule('/', $this->prefixSettings['path']);
52
- // if ($prefix) {
53
- // return static::finalOptionsRoute($prefix, $this->controllerId);
54
- // }
55
- // }
56
- // }
57
- // return $this->controllerId.'/options';
58
40
}
59
41
60
42
/**
@@ -96,28 +78,20 @@ public function getRoute(): string
96
78
if (!empty ($ this ->prefixSettings )) {
97
79
if (isset ($ this ->prefixSettings ['module ' ])) {
98
80
$ prefix = $ this ->prefixSettings ['module ' ];
99
- // return static::finalOptionsRoute($prefix, $this->controllerId);
100
81
return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
101
82
} elseif (isset ($ this ->prefixSettings ['namespace ' ]) && str_contains ($ this ->prefixSettings ['namespace ' ], '\modules \\' )) { # if `module` not present then check in namespace and then in path
102
83
$ prefix = static ::computeModule ('\\' , $ this ->prefixSettings ['namespace ' ]);
103
84
if ($ prefix ) {
104
- // return static::finalOptionsRoute($prefix, $this->controllerId);
105
85
return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
106
86
}
107
87
} elseif (isset ($ this ->prefixSettings ['path ' ]) && str_contains ($ this ->prefixSettings ['path ' ], '/modules/ ' )) {
108
88
$ prefix = static ::computeModule ('/ ' , $ this ->prefixSettings ['path ' ]);
109
89
if ($ prefix ) {
110
- // return static::finalOptionsRoute($prefix, $this->controllerId);
111
90
return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
112
91
}
113
92
}
114
93
}
115
94
116
- // if (!empty($this->prefixSettings)) {
117
- // $prefix = $this->prefixSettings['module'] ?? $this->prefix;
118
- // return trim($prefix, '/') . '/' . $this->controllerId . '/' . $this->id;
119
- // }
120
-
121
95
return $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
122
96
}
123
97
}
0 commit comments