Welcome Guest, Not a member yet? Register   Sign In
Instantiate model from helper

Is there a way I can instantiate my model from helper? I would like to it like this:

# user_helper.php
function user_form_session($session) {
$user = new User_model();
$user->email = $session['email'];
$user->password = $session['password'];
return $user;


Solved. Load the model from controller who is using the helper.

Or do it like this:

[code] $CI =& get_instance();

Theme © iAndrew 2016 - Forum software by © MyBB