Welcome Guest, Not a member yet? Register   Sign In
HMVC two modules passing the same variable name to their views and causing conflict
#1

[eluser]TomTom[/eluser]
I have two modules in my installation. Both modules' controllers pass a variable called $data['content'] to their views. Also, the first module's view runs the second module via <?php echo Modules::run('module2'); ?>, and after that is supposed to display values from its $data['content'] variable. Unfortunately, that's when the first module's $data content is substituted with the second module's $data. This is pretty inconvenient for me, so I wuold like to know if there is a way to "protect" the $content variables and keep them only within their associated modules?

I would like to avoid renaming $data['content'] if possible. I've found a not-so-perfect solution in using $data(__CLASS__), but I am curious if it is possible not to change $data['content'].


Messages In This Thread
HMVC two modules passing the same variable name to their views and causing conflict - by El Forum - 06-07-2012, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB