• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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?

#2
[eluser]Rey Philip Regis[/eluser]
I really don't get the your question? What's the connection between your login and the Accounts/about_us?

#3
[eluser]ryeguy[/eluser]
There is none - that's my point. I need to use a controller because I have a login box on the side of every page, but that's it.

#4
[eluser]Rey Philip Regis[/eluser]
can you post the code?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.