Welcome Guest, Not a member yet? Register   Sign In
create url's
#1

[eluser]bralens[/eluser]
How can i convert
Code:
My new post title with weird symbols āčēģīķļž
to
Code:
my-new-post-title-with-weird-symbols-acegiklz
?

and what i need to write in .htaccess to get this url?
Code:
http://example.com/my-new-post-title-with-weird-symbols-acegiklz
#2

[eluser]iConTM[/eluser]
This may work:

Code:
$title = "What's wrong with CSS?";

$url_title = url_title($title);

// Produces: Whats-wrong-with-CSS

http://ellislab.com/codeigniter/user-gui...elper.html
#3

[eluser]bralens[/eluser]
url_title() do not convert characters like āēčīžķ....
it will convert
Code:
My new post title with weird symbols āčēģīķļž
to
Code:
My-new-post-title-with-weird-symbols
but i realy need these simbols to be there
#4

[eluser]mddd[/eluser]
If you are using CodeIgniter 2.0 you can use the convert_accented_characters function from the text helper.
If you are using 1.7.2, I would suggest extending the url helper to include the functionality from the convert_accented_characters function from 2.0.
#5

[eluser]Clooner[/eluser]
Code:
function removeaccents($string)
{
  return strtr($string,
"ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝß
àáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ",
"SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
}
I see that some characters are missing though! Add them in case you need them. There are many functions like this in the forum!
#6

[eluser]bralens[/eluser]
thanks
and haw can i get url without controller and function names in it?
#7

[eluser]Clooner[/eluser]
[quote author="bralens" date="1281463738"]thanks
and haw can i get url without controller and function names in it?[/quote]
Look up Routes in the manual




Theme © iAndrew 2016 - Forum software by © MyBB