phprs\Invoker::bind PHP Method

bind() public method

绑定参数,返回值,异常
public bind ( integer $id, string $type, $param )
$id integer 参数id
$type string 绑定类型 param/return/throws
$param param: [['arg_name'=>'$._SERVER.REQUEST_URI'],...] [[参数名=>jsonpath表达式],...] 指定api接口参数从http请求中获取的方式 returns: 指定哪些参数被作为返回值 [ ['status','200 OK'], 200 OK 作为常量, 输出到status ['cookie','$arg0'], $arg0变量输出到cookie ['body'], 未指定变量, 则取返回值输出 ] throws 指定根据不同的异常设置响应信息 [ ['MyException','status' , '404 Not Found'], ['MyException','body','$msg'], ['Exception','status','500 Internal Server Error'], ]
    public function bind($id, $type, $param)
    {
        if (!isset($this->bind[$type])) {
            return;
        }
        $this->bind[$type]->set($id, $param, $this->method_args);
    }