Welcome Guest, Not a member yet? Register   Sign In
Loading controllers from a view
#3

[eluser]Bart Mebane[/eluser]
One way you can do it is to generate the table in the controller and pass it to your view:
Code:
function index(){
    $data['main_content'] = 'portfolio_home';
    $data['project_list'] = $this->listProjects();
    $this->load->view('portfolio',$data);
}

function listProjects(){
    $this->load->library('table');
    $query = $this->db->query("
        SELECT clients.client, project_list.project, project_list.role, project_list.url
        FROM clients, project_list
        WHERE clients.id = project_list.client_id
        GROUP BY clients.client, project_list.project
        ");
        
    return $this->table->generate($query);
}

Then in the view:
Code:
echo $project_list;


Messages In This Thread
Loading controllers from a view - by El Forum - 11-23-2010, 07:40 AM
Loading controllers from a view - by El Forum - 11-23-2010, 07:47 AM
Loading controllers from a view - by El Forum - 11-23-2010, 07:53 AM
Loading controllers from a view - by El Forum - 11-23-2010, 08:04 AM
Loading controllers from a view - by El Forum - 11-23-2010, 08:43 AM
Loading controllers from a view - by El Forum - 11-23-2010, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB