答案 0 :(得分:2)
您无需立即从构造中调用$this->validate()
。如果您在构造函数中填充$this->allForm
,则在调用类方法时该值将继续存在。从$this->validate()
移除__construct()
,您可以手动调用validate()
方法:
$authentication = new authentication( "1", "nanat", "amew", "yes" );
$authentication->validate();
根据您提出此问题的方式,这是我能提供的最佳答案。
答案 1 :(得分:1)