3

Symfony2 by default displays entity details by ID

 /** * Finds and displays a State entity. * @Route("state/{id}", name="state_show") * @Template() */ 

I'd like to display name of the state, but most of states contains special chars (Polish special chars).

Links work if I use {name} but it is safe to use special chars in link?

2
  • possible duplicate of Characters allowed in a URL Commented May 5, 2014 at 7:27
  • Question is more about how to change special chars to regular chars in Symfony than which chars are allowed. Commented May 5, 2014 at 8:30

3 Answers 3

2

You can use Gedmo extensions for that, especially Sluggable.

Sign up to request clarification or add additional context in comments.

Comments

2

Since you are not going to encode the URL, characters other than the following are unsafe.

  • alphanumeric,

  • Reserved ";", "/", "?", ":", "@", "=", "&",

  • Special characters: $-_.+!*'(),.

See this related answer.

Comments

0

In my opinion the best way (also for SEO) is to change polish letters to standard ones (for example ł => l, ą => a) and use - as words separators

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.