first commit
This commit is contained in:
15
app/common/middleware/AppLang.php
Normal file
15
app/common/middleware/AppLang.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace app\common\middleware;
|
||||
|
||||
use Webman\MiddlewareInterface;
|
||||
use Webman\Http\Response;
|
||||
use Webman\Http\Request;
|
||||
|
||||
class AppLang implements MiddlewareInterface
|
||||
{
|
||||
public function process(Request $request, callable $handler) : Response
|
||||
{
|
||||
locale(session('lang', 'zh_CN'));
|
||||
return $handler($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user