Community-Auth variables? |
I'm trying to access the variables inside the controller?
Code: class Front extends MY_Controller But unfortunately I got this error Code: Message: Undefined property: Front::$auth_username So why is this happening? skunkbad can you help me? thanks in advance.
No SEO spam
You haven't called any auth method, like is_logged_in, require_role, etc. The variables aren't going to be there until you do. Since you're in the constructor, you might just call $this->is_logged_in() before you need auth_username
thanks dude.
+1 to make it 20.
No SEO spam
actually I want the $auth_username in the view.
I tried like this below, Code: <?php but I got error. the proper way to acces the variables in view? thanks in advance.
No SEO spam
Is_logged_in is a controller method, so call it in the controller with $this->
Hi skunkbad sorry for this inconvenience.
I re-dig the codes again and I found out the documentation and the actual codes do not matched. In the documentation for example it says this for view variables. Code: $auth_username But the actual codes said this, Code: // Set user specific variables to be available in all views confusing lol
No SEO spam
(03-05-2016, 08:06 PM)solidcodes Wrote: Hi skunkbad sorry for this inconvenience. You may have an older version of Auth_Controller.php, because auth_user_name was switched to auth_username a while back. This change was made to avoid confusion, but apparently it created some
Yes I'm using old version of CodeIgniter 3.0 only and older version of Community-Auth.
This is fine for me now, because I'm in a hurry!!! lol
No SEO spam
|
Welcome Guest, Not a member yet? Register Sign In |