Is $view in an MVC php program a proper use of global variables?

  • Thread starter Thread starter K
  • Start date Start date

K

New Member
I understand that global variables should be avoided generally. As a beginner, I'm trying to understand whether making a $view variable global in a dynamic web program built following MVC principles is one of those cases where globals are a good idea.In my program, I create the $view (as an object that contains an empty array) in index.php, and turn it into a global in the controllers that use it.Thanks!JDelage
 
Back
Top