Community-Auth make this work in view? |
hi,
These codes work properly under controller. Code: if( $this->require_min_level(9) ) So how to make it work under view page? Thanks in advance.
Class members declared public can be accessed everywhere.
Class members declared protected can be accessed only within the class itself and by inherited classes. Class members declared as private may only be accessed by the class that defines the member. You would need to extend the class and create your own method to call that protected method. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(03-28-2016, 06:08 PM)iridion2015 Wrote: hi, require_min_level, require_role, and the other authentication methods are always used in the controller. Take a look at Community Auth's Examples controller to see the proper usage. This behavior is not exclusive to Community Auth. You will find that most, if not all authentication systems will authenticate in the controller (unless they are applied in the routing).
Does this code work properly ? Echo outside bracket and after if statement ?
NexoPOS 2.6.2 available on CodeCanyon.
(03-29-2016, 10:55 AM)iridion2015 Wrote: @skunkbad If there is a way, I'm not going to spend time figuring it out then posting a solution that goes against the basic principles of MVC. There would never be a good reason to use authentication functions n a view. I think if you spend time reading the Community Auth documentation, you'll find that Community Auth is very flexible and can do whatever you need. You might consider reading the CodeIgniter documentation as well. |
Welcome Guest, Not a member yet? Register Sign In |