PHP에 클래스가 있고 호출 할 때 함수 __construct($_POST)
이 처리되어야합니다.클래스 호출시 __construct에 오류가 발생했습니다.
__construct()
함수로 정의
// Constructor Function
function __construct($_POST){
$this->customer = trim($_POST['customer']);
$this->CreateDate = date('Y/m/d');
}
을 내가 클래스에있는 함수를 호출 할 때, 그 처리 및 데이터베이스에 삽입하지만 마사지가 나타날 수 있습니다 : -
Missing argument 1 for Draft::__construct(), called in ....
내 코드에 무슨
thankx
은 다음과 같이 다시 작성해야 하는가? – christopher
어떻게 수업을 시작합니까? 왜 생성자에서 $ _POST를 전달합니까?'function __construct ($ _ POST) {'대신 function __construct() {'가 문제를 해결할 것입니다. –