@@ -37,24 +37,6 @@ public function getOptionsRoute():string
3737 $ r = explode ('/ ' , $ r );
3838 array_pop ($ r );
3939 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';
5840 }
5941
6042 /**
@@ -96,28 +78,20 @@ public function getRoute(): string
9678 if (!empty ($ this ->prefixSettings )) {
9779 if (isset ($ this ->prefixSettings ['module ' ])) {
9880 $ prefix = $ this ->prefixSettings ['module ' ];
99- // return static::finalOptionsRoute($prefix, $this->controllerId);
10081 return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
10182 } elseif (isset ($ this ->prefixSettings ['namespace ' ]) && str_contains ($ this ->prefixSettings ['namespace ' ], '\modules \\' )) { # if `module` not present then check in namespace and then in path
10283 $ prefix = static ::computeModule ('\\' , $ this ->prefixSettings ['namespace ' ]);
10384 if ($ prefix ) {
104- // return static::finalOptionsRoute($prefix, $this->controllerId);
10585 return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
10686 }
10787 } elseif (isset ($ this ->prefixSettings ['path ' ]) && str_contains ($ this ->prefixSettings ['path ' ], '/modules/ ' )) {
10888 $ prefix = static ::computeModule ('/ ' , $ this ->prefixSettings ['path ' ]);
10989 if ($ prefix ) {
110- // return static::finalOptionsRoute($prefix, $this->controllerId);
11190 return trim ($ prefix , '/ ' ) . '/ ' . $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
11291 }
11392 }
11493 }
11594
116- // if (!empty($this->prefixSettings)) {
117- // $prefix = $this->prefixSettings['module'] ?? $this->prefix;
118- // return trim($prefix, '/') . '/' . $this->controllerId . '/' . $this->id;
119- // }
120-
12195 return $ this ->controllerId . ($ this ->id ? '/ ' . $ this ->id : '' );
12296 }
12397}
0 commit comments