[eluser]InsiteFX[/eluser]
You need to build a data array with the message information, you do not want to loop through
it in your model.
I would create a message library and add methods to it to access the model and the updating etc.
you can then loop through the data array and add anchors to it with the msg_id.
Code:
<?php echo anchor('controller/function/'.$msg_id, 'text', $attributes); ?>
This is from Adam Griffins Auth 106 but will give you an idea of how to do it.
It uses CodeIgniters Table Class
Code:
// --------------------------------------------------------------------
/**
* manage()
*
* Description:
*
* @access public
* @param string
* @return void
*/
public function manage()
{
// Grab an array of users from the database
$data = $this->users->users();
// Setting headings for the table
$this->table->set_heading('Username', 'Email', 'Actions');
foreach($data as $value => $key)
{
// Build actions links
$actions = anchor("admin/users/edit/".$key['id']."/", "Edit") . anchor("admin/users/delete/".$key['id']."/", "Delete");
// Adding row to table
$this->table->add_row($key['username'], $key['email'], $actions);
}
// Load the Auth specific view
$this->load->view('controller/manage');
}
This would go into your controller