-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
小优化 #323
Comments
$controller=str_replace('.','\',$controller); // \是 重复2次的 github的显示问题了 |
walkor
added a commit
to walkor/webman-framework
that referenced
this issue
Jul 15, 2022
感谢反馈。 |
嗯 以点来分割控制器 这个不重要 需要的人 可以自己实现 感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vendor\workerman\webman-framework\src\App.php:486
loadController 这个函数
if (\is_dir($file) || false === \strpos(strtolower($file), '/controller/') || $spl_file->getExtension() !== 'php') {
continue;
}
改为
if (\is_dir($file) || false === \strpos(strtolower($file), DIRECTORY_SEPARATOR.'controller'.DIRECTORY_SEPARATOR) || $spl_file->getExtension() !== 'php') {
continue;
}
对window 会好一些
http://127.0.0.1:19730/admin/menu.index/index 比如更深的控制器
class Server extends App{
balabalabala......
protected static function parse_controller_action($path){
$suffix = config('app.controller_suffix', '');
$path_explode = explode('/', trim($path, '/'));
$app = !empty($path_explode[0]) ? $path_explode[0] : 'index';
$controller = $path_explode[1] ?? 'index';
$controller=str_replace('.','\',$controller);// 我这边支持多层控制器的方法
$action = $path_explode[2] ?? 'index';
if (isset($path_explode[2])) {
$controller_class = "app\$app\controller\$controller$suffix";
if ($controller_action = static::get_controller_action($controller_class, $action)) {
return $controller_action;
}
}
The text was updated successfully, but these errors were encountered: