Welcome Guest, Not a member yet? Register   Sign In
Convert a string into URL safe?
#1

[eluser]gvillavizar[/eluser]
Hello,

I want to achieve this:

Code:
http://mysite.com/blog/this-is-a-blog-title

I will strip the index.php part of CI.

I figured out that with routing I can get it to look like this, but in order to generate the links and compare then I need a function that will take:

This is a blog title!

And change it to:

this-is-a-blog-title

Doing this is no problem, but I want to know first if CI has some kind of helper or library that can help me achieve this faster (after all, that's the reason to use a framework in the first place).

I searched in the guide and couldn't find what I want.
#2

[eluser]davidbehler[/eluser]
Try "url_title()" in URL helper
#3

[eluser]gvillavizar[/eluser]
[quote author="waldmeister" date="1238612566"]Try "url_title()" in URL helper[/quote]

Wow, great!

Thanks.

I did searched in the url helper but I didn't noticed this function.

Thanks again.




Theme © iAndrew 2016 - Forum software by © MyBB