What is the term for a name converted to a URL par

2019-09-08 16:58发布

I want to learn what is it called -if there is any name for it- when you convert a name to a URL parameter, like, urldecode() in PHP.

Suppose in my database, I list some TV series, and one row is for The Big Bang Theory, I usually do it like:

title                  name
------                 -----
The Big Bang Theory    the-big-bang-theory

So is there a specific name for the second column, named "name"?

I remember something like "slug" or "stub" from one of the CMS’.

1条回答
Emotional °昔
2楼-- · 2019-09-08 17:50
http://example.com/articles/the-big-bang-theory?revision=1
  • Path:
    /articles/the-big-bang-theory

  • Path segments/subcomponents:
    articles
    the-big-bang-theory

  • Slug (not a technically defined term):
    the-big-bang-theory


http://example.com/articles/427ds17v223?revision=1
  • Path:
    /articles/427ds17v223

  • Path segments/subcomponents:
    articles
    427ds17v223

  • Slug (not a technically defined term):
    none, or 427ds17v223


There are various definitions for the term slug. Some may always call the last path segment a slug, some may use this term only if the last path segment is human-readable/understandable.

查看更多
登录 后发表回答