Welcome Guest, Not a member yet? Register   Sign In
Functions in MY_Controller
#1

[eluser]bleu[/eluser]
I have MY_Controller which is then used by other controllers.

I have Various functions in MY_Controller .

How would I declare them?

They surely won't be
Code:
public function function_name{}

will they just be
Code:
function function_name{}
or something else?
#2

[eluser]PhilTem[/eluser]
Code:
function function_name{}
// is the same as
public function function_name{}

if you're using PHP > 5.0 (I think it was introduced within 5.0, but maybe later, something like 5.3).

I usually declare functions public or protected. Depending on if they're public functions (uri functions) or non-uri functions. You should definitely read [urlhttp://php.net/manual/en/language.oop5.visibility.php[/url] for general thoughts about function visibility.
#3

[eluser]jellysandwich[/eluser]
http://ellislab.com/codeigniter/user-gui...ml#private




Theme © iAndrew 2016 - Forum software by © MyBB