Fatal error: Call to a member function isLogged() on a non-object in
我在本地上测试没问题 上传到服务器上进入后台的时候就报错 前台没问题 那位高人遇见过这种问题 麻烦告诉声 谢谢
本地是Apache 服务器上是nginx 急
我在本地上测试没问题 上传到服务器上进入后台的时候就报错 前台没问题 那位高人遇见过这种问题 麻烦告诉声 谢谢
本地是Apache 服务器上是nginx 急
解决方案 »
- 【求助】PHP的Switch语句case无法选择
- 一个PHP环境安装过程中的遇到的问题,请大家帮忙解释一下
- $$name和"$$name"的区别
- cakephp无法访问例子 posts
- 怎么用正则匹配带多个属性的html标签
- 后台所有操作员的重要操作进行纪录,怎么实现?
- 怎么用JAVASCRIPT全部选定checkbox框呢?
- 大连地区招聘PHP程序员,专职兼职均可
- 我自已的网站正式开通,WELCOME 你来参观哟!
- 循环拼接表格崩溃
- 我做了个下载功能,能下载,但是下载的图片不能预览,doc文件打开是乱码,反正就是没有正常的
- 这个php。转换json到底要怎么嘛!javascript就是提示错误
public function getProduct($product_id) {
if ($this->customer->isLogged()) { 报的错误在这一行
$customer_group_id = $this->customer->getCustomerGroupId();
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
public function isLogged() {
return $this->customer_id;
}
private $customer_id;
private $firstname;
private $lastname;
private $email;
private $telephone;
private $mobile;
private $newsletter;
private $customer_group_id;
private $address_id;
public function __construct($registry) {
$this->config = $registry->get('config');
$this->db = $registry->get('db');
$this->request = $registry->get('request');
$this->session = $registry->get('session');
if (isset($this->session->data['customer_id'])) {
$customer_query = $this->db->query();
if ($customer_query->num_rows) {
$this->customer_id = $customer_query->row['customer_id'];
$this->firstname = $customer_query->row['firstname'];
$this->lastname = $customer_query->row['lastname'];
$this->email = $customer_query->row['email'];
$this->telephone = $customer_query->row['telephone'];
$this->mobile = $customer_query->row['mobile'];
$this->newsletter = $customer_query->row['newsletter'];
$this->customer_group_id = $customer_query->row['customer_group_id'];
$this->address_id = $customer_query->row['address_id'];
$this->db->query();
$query = $this->db->query();
if (!$query->num_rows) {
$this->db->query();
}
} else {
$this->logout();
}
}
错误提示,明显是$this->customer不存在,是null