1

I've been working with CodeIgniter and I'm wondering if the way I'm setting up my controllers is not correct.

I'm trying to incorporate an admin section of my site using the method 2 found on Phil Sturgeon's blog.

If I also needed a controller to handle products and users in my front-end, could I name them products.php and users.php or would they cause conflicts?

Thank you for your help!

File Structure

2
  • @RPM, looks like a simple finder window to me. Commented Dec 11, 2012 at 21:04
  • @RPM Yeah, I just used a finder window to demonstrate the file structure. Commented Dec 11, 2012 at 21:13

1 Answer 1

2

You can use same controller name for both side (backend and frontend) within two different folders, i.e.

admin/users.php 
front/users.php

But you can also use a prefix for readability or to avoid confusions, like

admin/adm_users.php // read as admin users.php
front/frn_users.php // read as frontend users.php
Sign up to request clarification or add additional context in comments.

1 Comment

how does this affect urls, because mysite.com/index.php/frn_users/ looks a bit silly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.