@@ -38,23 +38,23 @@ public function getOptionsRoute():string
38
38
array_pop ($ r );
39
39
return implode ('/ ' , $ r ) . '/options ' ;
40
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 ' ;
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
58
}
59
59
60
60
/**
@@ -97,18 +97,18 @@ public function getRoute(): string
97
97
if (isset ($ this ->prefixSettings ['module ' ])) {
98
98
$ prefix = $ this ->prefixSettings ['module ' ];
99
99
// return static::finalOptionsRoute($prefix, $this->controllerId);
100
- return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . '/ ' . $ this ->id ;
100
+ return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ( $ this -> id ? '/ ' . $ this ->id : '' ) ;
101
101
} elseif (isset ($ this ->prefixSettings ['namespace ' ]) && str_contains ($ this ->prefixSettings ['namespace ' ], '\modules \\' )) { # if `module` not present then check in namespace and then in path
102
102
$ prefix = static ::computeModule ('\\' , $ this ->prefixSettings ['namespace ' ]);
103
103
if ($ prefix ) {
104
104
// return static::finalOptionsRoute($prefix, $this->controllerId);
105
- return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . '/ ' . $ this ->id ;
105
+ return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ( $ this -> id ? '/ ' . $ this ->id : '' ) ;
106
106
}
107
107
} elseif (isset ($ this ->prefixSettings ['path ' ]) && str_contains ($ this ->prefixSettings ['path ' ], '/modules/ ' )) {
108
108
$ prefix = static ::computeModule ('/ ' , $ this ->prefixSettings ['path ' ]);
109
109
if ($ prefix ) {
110
110
// return static::finalOptionsRoute($prefix, $this->controllerId);
111
- return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . '/ ' . $ this ->id ;
111
+ return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ( $ this -> id ? '/ ' . $ this ->id : '' ) ;
112
112
}
113
113
}
114
114
}
@@ -118,6 +118,6 @@ public function getRoute(): string
118
118
// return trim($prefix, '/') . '/' . $this->controllerId . '/' . $this->id;
119
119
// }
120
120
121
- return $ this ->controllerId . '/ ' . $ this ->id ;
121
+ return $ this ->controllerId . ( $ this -> id ? '/ ' . $ this ->id : '' ) ;
122
122
}
123
123
}
0 commit comments