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