Removing ID from CakePHP URL?

前端 未结 3 528
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 04:44

Hey guys! Working on a new Cake app and wondering if there is anyway for me to remove the ID-in-URL routing from Cake. Perhaps by passing the ID in POST somehow? Having the ID p

3条回答
  •  花落未央
    2021-01-29 05:21

    Some people prefer using slugs instead of primary key ids. This is the removing-id-from-cakephp-url part of the URL from this page. Take a look at the SluggableBehavior.

    However, slugs can change. Hence, having the primary key in your URL is useful if you want to have a permalink. StackOverflow does both so that it can support both permalinking from other sites, as well as for SEO reasons. :)

    Regarding security issues, I guess the other answers have already pointed out that there are other ways to make your application secure.

提交回复
热议问题