自定义类:
namespace AppHttpservicesregister;
use AppHttpmodelregistersign;
use AppHttpservicescommonInter;
use AppHttpservicescommonDemo;
use IlluminateHttpRequest;
use IlluminateContractsValidationValidator;
class Resign extends Demo implements Inter{
public $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function logic(){
dd($this->request->all());
}
}
控制器:
namespace AppHttpControllersAdmin;
use AppHttpservicescommonDemo;
use IlluminateHttpRequest;
use AppHttpservicesregisterResign;
use IlluminateContractsValidationValidator;
class SignController extends Demo
{
public function Register(){
$reg =new Resign((new Request()));
$reg->logic();
}
}
请问 :我依赖注入Request 类 ,我在自定义类里打印 总是空数组,我前台表单 已经提交数据了。