[eluser]fesweb[/eluser]
Even better? Create a function in a/the model which checks the login status and writes the link.
This is probably horribly wrong to do...
Code:
function check_login() {
if logged in
$log_link = '<a href="logout">Logout</a>';
else
$log_link = '<a href="login">Login</a>';
end if
return $log_link;
}
...but you could do something like this instead...
Code:
function check_login() {
if logged in
$log_view = 'utilities/logout_link';
else
$log_view = 'utilities/login_link';
end if
return $log_view;
}
...then, in the controller(s)...
Code:
$this->load->view($this->your_model->check_login());
Either way, if the link or wording changes later, you just change it one in the one function or view.