Welcome Guest, Not a member yet? Register   Sign In
Page slugs
#1

[eluser]Wonder Woman[/eluser]
Hi,

I was wondering how I can change my urls so that they are friendly, for example:

example.com/news/my-first-article

instead of

example.com/news/1

and how would I change


example.com/privacy_policy

to

example.com/privacy-policy

I want to do this dynamically instead of configuring them individually in my routes.php file.

Thanks
#2

[eluser]fraserk[/eluser]
You can user $url_title to accomplish this.
Code:
$title = "What's wrong with CSS?";

$url_title = url_title($title);

// Produces: Whats-wrong-with-CSS




Theme © iAndrew 2016 - Forum software by © MyBB