我一直在使用CodeIgniter,我想知道如果我设置我的控制器的方式是不正确的。CodeIgniter - 最佳控制器命名协议?
我正在尝试使用method 2 found on Phil Sturgeon's blog合并我的网站的管理部分。
如果我还需要一个控制器来处理我的前端产品和用户,我可以将它们命名为products.php和users.php,否则它们会导致冲突?
谢谢你的帮助!
我一直在使用CodeIgniter,我想知道如果我设置我的控制器的方式是不正确的。CodeIgniter - 最佳控制器命名协议?
我正在尝试使用method 2 found on Phil Sturgeon's blog合并我的网站的管理部分。
如果我还需要一个控制器来处理我的前端产品和用户,我可以将它们命名为products.php和users.php,否则它们会导致冲突?
谢谢你的帮助!
您可以将两个不同的文件夹内的两侧(后端和前端)使用相同的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
这是如何影响网址的,因为mysite.com/index.php/frn_users/看起来有点傻? – Tom
@Vecta,不客气:-) –
这是什么IDE? –
@RPM,看起来像一个简单的[finder](http://en.wikipedia.org/wiki/Finder_(software))窗口给我。 – complex857
@ complex857 ahhh –