2012-12-11 48 views
1

我一直在使用CodeIgniter,我想知道如果我设置我的控制器的方式是不正确的。CodeIgniter - 最佳控制器命名协议?

我正在尝试使用method 2 found on Phil Sturgeon's blog合并我的网站的管理部分。

如果我还需要一个控制器来处理我的前端产品和用户,我可以将它们命名为products.php和users.php,否则它们会导致冲突?

谢谢你的帮助!

File Structure

+0

这是什么IDE? –

+0

@RPM,看起来像一个简单的[finder](http://en.wikipedia.org/wiki/Finder_(software))窗口给我。 – complex857

+0

@ complex857 ahhh –

回答

2

您可以将两个不同的文件夹内的两侧(后端和前端)使用相同的controller名称,即

admin/users.php 
front/users.php 

但你也可以使用一个prefix的可读性和避免混乱,像

admin/adm_users.php // read as admin users.php 
front/frn_users.php // read as frontend users.php 
+1

这是如何影响网址的,因为mysite.com/index.php/frn_users/看起来有点傻? – Tom

+0

@Vecta,不客气:-) –