How do I build URL's like this ({title}-{id})? |
[eluser]Carmichael[/eluser]
Is there a CI function built that receives the id from the URL or do I have to create one by my self? http://site.com/blog/welcome-to-my-blog-194/
[eluser]Aken[/eluser]
A specific function just for that? No. But you can use routes to separate it, or just pick apart the URI segment.
[eluser]InsiteFX[/eluser]
application/config/routes.php Code: $route['blog/welcome-to-my-blog/(:any:)] = 'blog/welcome-to-my-blog/$1';
[eluser]Carmichael[/eluser]
[quote author="InsiteFX" date="1341619093"]application/config/routes.php Code: $route['blog/welcome-to-my-blog/(:any:)] = 'blog/welcome-to-my-blog/$1'; I want a - between the title and the id. Like http://blog.se/welcome-to-my-blog-1 That's not possible? |
Welcome Guest, Not a member yet? Register Sign In |