[eluser]Gavin Vickery[/eluser]
You could format the values returned from your SQL, and assign them to a new variable before you send it to the view
Code:
function index()
{
$this->load->database();
$sql = "SELECT region_id, region_name FROM regions ORDER BY region_id ASC";
$query = $this->db->query($sql);
$viewData['link_html'] = "";
foreach($query->result() as $row)
{
$viewData['link_html'] .= '<li>';
$viewData['link_html'] .= '<a href="/detail/'.$row->region_name.'/'.$row->region_id.'/property-in-'.$row->region_name.'.html">';
$viewData['link_html'] .= $region->region_name;
$viewData['link_html'] .= '</a>';
$viewData['link_html'] .= '</li>\n';
}
$this->load->view('home', $viewData);
}
This makes your view very easy
Code:
<ul><?=$link_html?></ul>
Obviously you don't need to break out the link in the index() function that much, I just did it for clarity.
Hope that helps.