[eluser]Unknown[/eluser]
Hello @vesparny and all CI coders.
I just got started my journey with this framework and it's great - even for newbies like me.
Although, I have a problem with integrating Tank auth library with your bootstrap pack.
I mean, I know that there's a template view for every website element like header, footer etc.
But I can't figure out how to make login form in the navbar.
I discovered that TankAuth has a following code in home controller:
Code:
if (!$this->tank_auth->is_logged_in()) {
redirect('/auth/login/');
} else {
$this->data['user_id'] = $this->tank_auth->get_user_id();
$this->data['username'] = $this->tank_auth->get_username();
$this->data['role'] = $this->tank_auth->get_role();
$this->_render('pages/home');
}
And I already connected it with your
_render method, which is awesome at the point
But, still can't put the login form inside the navbar without making crappy code
Do I have to write a method in nav_helper (like isLoggedIn) ? Or is there a better way to make it work?
Thank you in advance
Cheers