Welcome Guest, Not a member yet? Register   Sign In
news story titles in urls
#3

[eluser]LittleBop[/eluser]
Hi,

actually I do it like this (I'm a beginner, so, it's not sure that this is the best way to answer your problem)

routes.php
Code:
$route['yourcontroller/([0-9]+)(_[a-zA-Z0-9-]*)?'] = "yourcontroller/yourshowingmethod/$1";

And, on my views:
Code:
<?=anchor("yourcontroller/".$row->id."_".url_title($row->title), $row->title)?>

Examples :
yourcontroller/ -> list of elements
yourcontroller/5 -> element with id = 5
yourcontroller/5_my-title -> element with id = 5 with its title on the URL
yourcontroller/5_a-fake-title -> works too and get element with id = 5 too but not really matter Wink

I wish I answer your question...

++


Messages In This Thread
news story titles in urls - by El Forum - 06-22-2007, 07:54 AM
news story titles in urls - by El Forum - 06-22-2007, 08:33 AM
news story titles in urls - by El Forum - 06-22-2007, 08:43 AM
news story titles in urls - by El Forum - 06-22-2007, 09:20 AM
news story titles in urls - by El Forum - 06-22-2007, 10:18 AM
news story titles in urls - by El Forum - 06-22-2007, 06:06 PM
news story titles in urls - by El Forum - 06-23-2007, 02:26 AM
news story titles in urls - by El Forum - 06-23-2007, 04:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB