Fatal error: Call to a member function isLogged() on a non-object in
我在本地上测试没问题  上传到服务器上进入后台的时候就报错 前台没问题  那位高人遇见过这种问题  麻烦告诉声 谢谢 
本地是Apache 服务器上是nginx  急

解决方案 »

  1.   

    看下代码,是对象为空造成的,看下什么对象调用 isLogged
      

  2.   

    就检查你的 isLogged 调用到的地方是否有问题.这个得自己检查代码了。
      

  3.   


    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();
    }
       }
      

  4.   

    $this->customer在哪定义的?  
      

  5.   

    $this->customer如果是继承来的,那么你确定它有被初始化或者赋值吗?
    错误提示,明显是$this->customer不存在,是null