walkor / webman-framework

webman-framework
116 stars 57 forks source link

1.Fix:when visit the homepage found 404; 2.Add:customize the default home page config #63

Open taozywu opened 2 years ago

taozywu commented 2 years ago

1.Fix:when visit the homepage found 404;
2.Add:customize the default home page config

The following are some configurations.

app.php
// the default app name, if single application please input "" or "app"
"default_app" => "index",
// the default controller name
"default_controller" => "index",
// the default action name
"default_action" => "index",
taozywu commented 2 years ago

Of course you can do this

Route.php

//redirect
Route::any('/', function ($request) {
     return redirect("/index");
});

or

//使用类
Route::any('/', [app\index\controller\Index::class, 'index']);