0

I have used object oriented more in java, where a private member cannot be accessed from outsite the class, protected extending access to child classes, default access extending access to packages and public to every class.

How does this work in PHP when using MVC frameworks( I am using CodeIgniter)? Does it mean all methods in models which I will be accessing from Controllers have to be public?

2
  • And what is the default access in PHP( when I do not specify).What does it do? Commented Apr 26, 2011 at 20:06
  • Sounds to me like you need to read up on php OOP: php.net/manual/en/language.oop5.php. Looks like you also need to brush up on your accepts. Commented Apr 26, 2011 at 20:07

2 Answers 2

1

It means the same thing.

There are no friend classes in php, so you cant break private just because you are using a MVC pattern. Note this is true in Java as well.

Sign up to request clarification or add additional context in comments.

Comments

1

This isnt really CI specific... but yes. check out: http://www.php.net/manual/en/language.oop5.visibility.php for more info on php method/property visibility.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.