feat: 本次提交更新内容如下

php有问题,覆盖下
This commit is contained in:
笔记本里的永平
2025-07-07 14:52:56 +08:00
parent c29fbd1bbb
commit c9a3aaab58
338 changed files with 70315 additions and 12737 deletions

View File

@@ -11,30 +11,36 @@
namespace think\console\command\make;
use think\Config;
use think\console\command\Make;
use think\console\input\Option;
use think\facade\Config;
class Controller extends Make
{
protected $type = "Controller";
protected function configure()
{
parent::configure();
$this->setName('make:controller')
->addOption('api', null, Option::VALUE_NONE, 'Generate an api controller class.')
->addOption('plain', null, Option::VALUE_NONE, 'Generate an empty controller class.')
->setDescription('Create a new resource controller class');
}
protected function getStub()
{
if ($this->input->getOption('plain')) {
return __DIR__ . '/stubs/controller.plain.stub';
$stubPath = __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR;
if ($this->input->getOption('api')) {
return $stubPath . 'controller.api.stub';
}
return __DIR__ . '/stubs/controller.stub';
if ($this->input->getOption('plain')) {
return $stubPath . 'controller.plain.stub';
}
return $stubPath . 'controller.stub';
}
protected function getClassName($name)

View File

@@ -26,7 +26,7 @@ class Model extends Make
protected function getStub()
{
return __DIR__ . '/stubs/model.stub';
return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'model.stub';
}
protected function getNamespace($appNamespace, $module)

View File

@@ -12,7 +12,7 @@ class {%className%} extends Controller
*
* @return \think\Response
*/
public function index()
public function index{%actionSuffix%}()
{
//
}
@@ -22,7 +22,7 @@ class {%className%} extends Controller
*
* @return \think\Response
*/
public function create()
public function create{%actionSuffix%}()
{
//
}
@@ -33,7 +33,7 @@ class {%className%} extends Controller
* @param \think\Request $request
* @return \think\Response
*/
public function save(Request $request)
public function save{%actionSuffix%}(Request $request)
{
//
}
@@ -44,7 +44,7 @@ class {%className%} extends Controller
* @param int $id
* @return \think\Response
*/
public function read($id)
public function read{%actionSuffix%}($id)
{
//
}
@@ -55,7 +55,7 @@ class {%className%} extends Controller
* @param int $id
* @return \think\Response
*/
public function edit($id)
public function edit{%actionSuffix%}($id)
{
//
}
@@ -67,7 +67,7 @@ class {%className%} extends Controller
* @param int $id
* @return \think\Response
*/
public function update(Request $request, $id)
public function update{%actionSuffix%}(Request $request, $id)
{
//
}
@@ -78,7 +78,7 @@ class {%className%} extends Controller
* @param int $id
* @return \think\Response
*/
public function delete($id)
public function delete{%actionSuffix%}($id)
{
//
}