0
我有我是PHP中的nubie。 我有一个问题的打击。如何解决未定义的属性
Notice on line 328 in file modules/swipe/swipe.php
[8] Undefined property: Swipe::$_postErrors
public function getContent() {
$this->_html = '<img src="'.$this->_p otocol.$this->context->shop->domain.$this->_path.'logo-big.png" style="margin-bottom:20px" />';
if (Tools::isSubmit('btnSubmit')) {
$this->_postValidation();
if (!count($this->_postErrors)) **((Line 328))**
$this->_postProcess();
else
foreach ($this->_postErrors as $err)
$this->_html .= '<div class="alert error">' . $err . '</div>';
}
else
$this->_html .= '<br />';
$this->_displayTop();
$this->_displayForm();
return $this->_html;
}
}
你能帮我解决这个问题吗? 我附上了swipe.php文件。
谢谢。
只要声明它。 'private $ _postErrors = array();' –
谢谢。这是Vp_arth最简单的方法。 – HappyDayToday