开发者

How do you prefer to structure your controller(s) in CodeIgniter?

开发者 https://www.devze.com 2022-12-22 05:38 出处:网络
I was wondering how you find it most easy to setup your controllers. Do you use one controller pr. sub-section of your site (ie. “Friends”, “Inbox”, “My account” etc.), or do you just use one开发

I was wondering how you find it most easy to setup your controllers. Do you use one controller pr. sub-section of your site (ie. “Friends”, “Inbox”, “My account” etc.), or do you just use one开发者_JAVA技巧 controller that keeps all of the sub-sections?


I use them as follows

-User
---login
---register
---logout
---forgotpassword

-Messages
---Inbox
---Sent
---Archived

-Account
---Login
---Notifications
---Billing

etc down the line

this keeps your codebase neat and tidy

if you want your url to be like http://mysite.com/login then you can set a custom route in config/routes.php

0

精彩评论

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