Why so private?

Hi. I’ve been working as a Yii developer for a while now, and there’s one thing that I find to be annoying about the standard classes: Many of the core functions and variables are declared as “private”. My issue is that it means the behavior cannot be altered without a ) re-declaring the variable and b ) re-declaring every function that uses it.

I just had this problem today:

I have a page which renders items in a random order every time it is called. These items each have a section that needs to be rendered differently based on the user’s display settings, so I chose to use renderDynamic. Unfortunately, renderDynamic bases the ID on the order in which items appear on the page, meaning that the dynamic fragment from one section is then rendered in another section when they change order. To override this, I had to copy the _dynamicOutput, plus every function that uses it, into my overridden Controller class.

I know I’ve run into similar issues in the past. Would it not be possible to make more of the built-in functions accessible, rather than private, or at-least to provide lower-level protected access to them?

Submit issues like this one to issue tracker at github. We’ll check what we can do about it. If we’ll make everything protected without checking for use-cases and solutions we’ll not be able to improve framework and keep it backwards compatible at the same time.