前段时间因为业务需求,使用TP的command开发了几个模块,期间测试一下在控制器中调用命令的方式,发现一些问题记录一下 官方文档: <?php namespace app\index\controller; use think\Console; use think\Controller; class Index extends Controller { public function hello($name) { $output = Console::call('hello ' . $name…
关于如何调用 mvc Web api 的方法,网上一搜就是一大把,基本都是在前台jq中调用的,但是如何在后台调用呢? 本楼主做了一下测试,仅供参考. 先写一个简单的api,如下:[域1] namespace SnsChess.api { public class UpdateGDController : ApiController { [HttpGet] public Result Post(string pub, string appid, string version, string…