Welcome Guest, Not a member yet? Register   Sign In
public function
#1

Hello,

I have a quick question regarding the function of writing "public" in the beginning of function.

What is the difference between writing:


models/Mpages.php


PHP Code:
public function login() {}

and

function 
login() {} 
" If I looks more intelligence please increase my reputation."
Reply
#2

It's the same. The first one is more explicit and you should use it for better clarity.

For more info:
http://stackoverflow.com/questions/43615...-protected
Reply
Reply
#4

in writing inside the class you have to specify whether it is public, static, or private.
God Bless CI Contributors Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB