Welcome Guest, Not a member yet? Register   Sign In
_ci_view_path to _ci_view_paths
#1

[eluser]JCianflone[/eluser]
why the change?

and why isn't the view path a variable that I can easily change without extending the loader class? Seems pretty stupid to have to extend the loader class to change a single line of code. Am I missing something?

and upgrading from 2.0 to 2.0.2 broke 4 sites on me because of this single line change....where are the release notes??
#2

[eluser]WanWizard[/eluser]
The underscore indicates a private variable, in PHP4 there was no way to actually make it private.
Now that CI is PHP5, there is. So expect to see more of these changes.

Internal class variables should never be changed directly by 'client' code, but always through a class method where you can control the modification.
#3

[eluser]JCianflone[/eluser]
True, I know it's a private variable, and it's not like I'm mad that they made the change. They changed part of the system that is seamless to anyone working with CI and making changes to private vars is a "at your own risk" type of thing. However, if you give developers a way to move the system directory AND the application directory it should seem obvious that developers are going to want the control to move the views. We just need an exposed variable that we can move the views directory around. It's a simple function...I already wrote it. Smile

Actually....one other note too...I don't necessarily agree with the whole this is private expect more changes thing. If you give people the ability to extend core classes, you have to expect these types of things. Maybe this change was well documented, I'm not sure, I didn't see it and it took me digging into the loader class to find this change...I'm just glad I only nuked a few local sites Smile
#4

[eluser]danmontgomery[/eluser]
protected, not private, extending is a non-issue.
#5

[eluser]JCianflone[/eluser]
Yea, but why extend an entire class to change one var?

It should be:
$application_folder = 'application';

$view_folder = '/path/to/views';

in my index file and now you can do whatever you want to the internals, I don't have to extend and things can change with no worries.

Is there a reason why this has been avoided?




Theme © iAndrew 2016 - Forum software by © MyBB