1
致命錯誤:無法訪問受保護的屬性JException :: $代碼/.../templates/abrax/error.php線14個
行14-17:
if (($this->error->code) == '404') {
header('Location: http://www.example.com/404');
exit;
}
致命錯誤:無法訪問受保護的屬性JException :: $代碼/.../templates/abrax/error.php線14個
行14-17:
if (($this->error->code) == '404') {
header('Location: http://www.example.com/404');
exit;
}
使用干將,你不能直接訪問屬性,因爲它的知名度不public
像
if (($this->error->getCode()) == '404') {
...
試試這個
if ($this->_error->get('code') == '404') {
header('Location: http://www.example.com/404');
exit;
}
我面對這個同樣的問題,我改變了代碼,如你所說,但其他錯誤顯示對我說:'致命錯誤:在無法使用方法的返回值寫上下文' 這是什麼意思? – 2013-04-16 13:05:04
@JackZhang你究竟寫了什麼,你能複製錯誤的行嗎?你把'='代替了== ==嗎? – 2013-04-16 13:35:08
這解決了這個問題。 Joomla 3.3 – davimusprime 2014-05-29 20:34:58