Welcome Guest, Not a member yet? Register   Sign In
How do you structure your code?
#1

[eluser]ryeguy[/eluser]
CodeIgniter is great in practice, but I'm running into difficulty using it for an actual site. I have a small login box on the left navigation bar that is made in CI, but the rest of the page is normal HTML. Where would I put the code for these controller wise? My main controller is called Accounts (as this is what I am mostly using it for), but it seems stupid to make stuff like Accounts/about_us, Accounts/what_do_we_do, etc. What I do is I have a function called _login_form which fills an array with variables I pass to the view to render the login form. For the regular pages, all I end up doing is something like:
Code:
function about_us()
{
    $this->load->view('about_us', $this->_login_form());
}

It just seems kind of out of place when I have about_us inside of the Accounts controller. Do most people just create a Nav controller or something?


Messages In This Thread
How do you structure your code? - by El Forum - 01-27-2009, 03:32 PM
How do you structure your code? - by El Forum - 01-27-2009, 03:41 PM
How do you structure your code? - by El Forum - 01-27-2009, 04:01 PM
How do you structure your code? - by El Forum - 01-27-2009, 04:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB