开发者

Is it good to pass CamelCase controller name in Cakephp URL?

开发者 https://www.devze.com 2023-04-08 14:40 出处:网络
Sorry for this basic question I have a c开发者_StackOverflow中文版ontroller named \"UserProfiles\" it contain a function named \"view\".

Sorry for this basic question

I have a c开发者_StackOverflow中文版ontroller named "UserProfiles" it contain a function named "view". But when a user login i redirecting to that view method. I using the following code : 1.) $this->redirect('/UserProfiles/view'); and i have other option 2.) $this->redirect('/user_profiles/view');

My Output: http://www.sample.com/UserProfiles/view Or http://www.sample.com/user_profiles/view

My doubt is which is correct standard to use in cakephp, and which of these 2 option will helpful for SEO friendly url ?


The CakePHP convention is that you use underscored and lowercase in your urls.

See: http://book.cakephp.org/view/904/Controller-Conventions#URL-Considerations-for-Controller-Names-905

0

精彩评论

暂无评论...
验证码 换一张
取 消