Welcome Guest, Not a member yet? Register   Sign In
I am creating a new library to codeignighter, seem i cannot use/load helper i've created
#2

[eluser]PhilTem[/eluser]
You need to wrap this code

Code:
$CI =& get_instance();// referencing as described in their website
$CI->load->helper('mylogin_helper');// loading the helper
public $member_session = is_member(); // using the function
public $username = $member_session['username'];
public $current_uID = $member_session['id'];
public $member_status = $member_session['status'];

into the __construct()-method to make it work, but before that you should define the variables as class attributes, so you don't get referencing errors.

That's because you can't use anything but

Code:
private $var = array(), NULL, FALSE, '';

as initial value for a class attribute. And you can't put $CI =& get_instance() inbetween the class tags without wrapping a method around it.


Messages In This Thread
I am creating a new library to codeignighter, seem i cannot use/load helper i've created - by El Forum - 10-19-2012, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB