Welcome Guest, Not a member yet? Register   Sign In
& get_instance()
#1
Sad 

good morning riends...

I'm not going to work with CI Hook. I'm trying to import "= & get_instance ()" but to no avail. I'm using version 3.1.6.

What can it be?


<?php

class Login
{
    public $CI;
    
     public function __construct()
     {
            // Assign the CodeIgniter super-object
        $this->CI =& get_instance();
     }

    function validar()
    {
        echo "validar";
        $this->CI->load->helper('url');
    }


error:

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: hooks/Login.php
Line Number: 16
Backtrace:
File: C:\xampp4\htdocs\crm-radiomar\application\hooks\Login.php
Line: 16
Function: _error_handler
File: C:\xampp4\htdocs\crm-radiomar\index.php
Line: 315
Function: require_once

Fatal error: Call to a member function helper() on null in C:\xampp4\htdocs\crm-radiomar\application\hooks\Login.php on line 16
A PHP Error was encountered
Severity: Error
Message: Call to a member function helper() on null
Filename: hooks/Login.php
Line Number: 16
Backtrace:


Thanks!
Tiago Cosme
Reply


Messages In This Thread
& get_instance() - by tiagocosme.ti - 10-03-2017, 04:18 AM
RE: & get_instance() - by InsiteFX - 10-04-2017, 02:00 AM
RE: & get_instance() - by Shawn - 10-08-2017, 08:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB