feat: 添加index应用模块

This commit is contained in:
2025-04-03 15:08:27 +08:00
parent 8eaa5559ef
commit 40aaca9f4e
10 changed files with 40 additions and 16 deletions

View File

@@ -1,12 +0,0 @@
<?php
declare (strict_types = 1);
namespace app\home\controller;
class Index
{
public function index()
{
return '您好!这是一个[home]示例应用';
}
}

View File

@@ -0,0 +1,12 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
class Index
{
public function index()
{
return '您好!这是一个[' . lang('home') . ']示例应用';
}
}

5
app/index/lang/en-us.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
return [
'home' => 'Home',
];

5
app/index/lang/zh-cn.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
return [
'home' => '首页',
];

View File

@@ -1,5 +1,6 @@
<?php
// 这是系统自动生成的middleware定义文件
return [
// 启用多语言支持
'think\middleware\LoadLangPack',
];

13
app/index/route/v1.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
Route::get('/', 'Index/index');