serengeti12
serengeti12

Reputation: 5586

How does inheritance work in codeIgniter MVC model

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?

Upvotes: 0

Views: 496

Answers (2)

prodigitalson
prodigitalson

Reputation: 60413

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.

Upvotes: 1

Byron Whitlock
Byron Whitlock

Reputation: 53851

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.

Upvotes: 1

Related Questions