[eluser]cahva[/eluser]
As I dont know exatcly what goes on in the rest of your controller, I assume the method's parameter should not be an array. Also I think you should just get the row with all the fields you need in one go from model.
Try this(I dont know if it will work as I said I dont know the big picture).
asset_mod model:
Code:
function get_asset($asset_id = FALSE)
{
if (!$asset_id)
{
return FALSE;
}
$row = $this->db->where('asset_id',$asset_id)->get('Assets')->row();
return $row; // will return FALSE if not found
}
details method from your controller:
Code:
function details($asset_id = FALSE)
{
if (!$asset_id)
{
redirect('catalog');
}
$asset = $this->assets_mod->get_asset($asset_id);
if (!$asset)
{
redirect('catalog');
}
$data = array(
'page_title' => 'Details',
'page_desc' => $asset->page_desc,
'asset_url' => $asset->asset_url,
'content' => 'view_asset'
);
$this->load->view('template', $data);
}
Was this what you were after?