无法将视图另存为要在模板中使用的变量

I am trying to call a model from my controller, which in turn generates data from a view, saves it as content and returns it to the controller, which then adds it to a template I have.

Whats happening is that $content = $this->load->view('left/profile', $c_data); is printing the data instead of saving it in variable $content

Here is my code:

Controller:

function index($page = '1-Welcome to')
{
        if (!$this->tank_auth->is_logged_in()) {
            //display non-login page
            redirect('/auth/login/');
        } else { 
    //user information
        $user['user_id'] = $this->tank_auth->get_user_id();
        $user['username'] = $this->tank_auth->get_username();
    //general page data
        $main['title'] = $this->page_model->make_title(ucfirst($page));
    //template data
        $template['head'] = $this->load->view('templates/head', $main, TRUE); 
    //get left content
        $c_data['make_profile'] = $this->left_model->make_profile($user);

    //combine into one variable
        $data['template'] = $template;
        $data['page'] = $page;
        $data['user'] = $user;
        $data['left'] = $c_data;
        print_r($data);
        $this->load->view('main_template', $data);
        }
}

Focus on $c_data['make_profile'] = $this->left_model->make_profile($user);

Here is make_profile

public function make_profile($user)
{
    $user_id = $user['user_id'];
    $query = $this->db->query(" SELECT location FROM user_profiles AS up 
                                INNER JOIN avatars AS a
                                ON up.avatar_id = a.id
                                WHERE user_id='$user_id'");
    $c_data['avatar_loc'] = $query->row_array();
    $content = $this->load->view('left/profile', $c_data);
    $content .= "hello";
    return $content;
}

And here is my profile view:

<div id="profile">
    <div id='avatar'><img src="<?php echo $avatar_loc['location'] ?>" alt="avatar_user"/></div>
    <div id="profile_pop"></div>
</div>

Any idea why it isn't working? Thanks

Return the data from the view as a string:

$this->load->view('left/profile', $c_data, TRUE);

Read here (bottom of the page).