致命错误:无法访问第 14 行 /.../templates/abrax/error.php 中的受保护属性 JException::$code
第 14-17 行:
if (($this->error->code) == '404') {
header('Location: http://www.example.com/404');
exit;
}
致命错误:无法访问第 14 行 /.../templates/abrax/error.php 中的受保护属性 JException::$code
第 14-17 行:
if (($this->error->code) == '404') {
header('Location: http://www.example.com/404');
exit;
}
Use getters, you can't access property directly because it's visibility is not public
Like
if (($this->error->getCode()) == '404') {
...
尝试这个
if ($this->_error->get('code') == '404') {
header('Location: http://www.example.com/404');
exit;
}