Welcome Guest, Not a member yet? Register   Sign In
Call to a member function helper() on a non-object
#1

[eluser]Doodlez[/eluser]
I do understand the error I just don't see why I am getting it.

I am sure that I am over looking something small but generate_confirmation() works no problem but
the 2nd function confirmation_link generates the error......
Call to a member function helper() on a non-object

Maybe its my eyes but they appear to be structured the same way
Code:
class Validate_email
{

//// create confirmation value
function generate_confirmation($userName,$email){
        $CI =& get_instance();

                $agent=$CI->input->ip_address();

                $confirmation =  sha1($email.$agent.'asdwq');
        
                RETURN $confirmation;
                }

////////////////////////////////////////////////////////////
//// add generated value to link to be sent to account page
function confirmation_link($confirmation){

        $CI =& get_instance();

                $CI->load->helper('url');

                $confirmation_link =  $CI->url->site_url("/registration/confirmed/account/$confirmation");

                RETURN $confirmation_link;
}      
}
#2

[eluser]Doodlez[/eluser]
I was playing with different ways to write it and now when I write

site_url("/registration/confirmed/account/$confirmation");

and not

$CI->url->site_url("/registration/confirmed/account/$confirmation");

it works fine.

Is this just an inconsistency in CI?
#3

[eluser]Doodlez[/eluser]
Ok I am going to continue to answer myself as I always do one is a library and one is a helper




Theme © iAndrew 2016 - Forum software by © MyBB