Welcome Guest, Not a member yet? Register   Sign In
Library vs. Controller
#3

[eluser]dmiden[/eluser]
Basically I use the libraries for classes that are used on all sites,
f.ex. I have a User library which handles login/logout/userdata etc.
This library has public $vars that are assigned when the class initialized.
So in my controllers I can f.ex. do this
Code:
function index()
{
   if ($this->user->authed == FALSE)
   {
      redirect('login/');
   }
}

The models are used for actions that arent used on all controllers.
F.ex. admin_model which handles all administration.


Messages In This Thread
Library vs. Controller - by El Forum - 10-28-2008, 02:22 AM
Library vs. Controller - by El Forum - 10-28-2008, 06:05 AM
Library vs. Controller - by El Forum - 10-28-2008, 07:50 AM
Library vs. Controller - by El Forum - 10-28-2008, 12:55 PM
Library vs. Controller - by El Forum - 10-28-2008, 06:47 PM
Library vs. Controller - by El Forum - 10-29-2008, 01:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB