View loading failure |
[eluser]ralf57[/eluser]
I've just found a strange behaviour trying to load a view while adding dynamic data to it. It's a peculiar case and i need it to be confirmed before i submit it to the Bug Tracker. My controller: Code: class MyController extends Controller If in the passed array there is a key named "path" the view is not loaded at all throwing this warning: Code: A PHP Error was encountered a quick check reveals that $data['path'] is used in libraries/Loader.php line 652 instead of the correct path. Removing the $data['path'] key will fix the problem. Is this a bug? Can you reproduce it? ------------------ Environement: PHP Version 5.2.1 Apache 2.2.3
[eluser]jedre[/eluser]
Hi, maybe it's small offtopic, but if you use PHP v. 5.2.1 why u write constructor in PHP4 style?
[eluser]ralf57[/eluser]
Instead of going off-topic, did you try and reproduce the behaviour/bug?
[eluser]xwero[/eluser]
do you have a myview.php file? ok that was not the question, you can skip my question. I tried to reproduce it and i got an error in the Loader class on line 639, a variable $path is used there.
[eluser]ralf57[/eluser]
[quote author="xwero" date="1188408739"] I tried to reproduce it and i got an error in the Loader class on line 639, a variable $path is used there.[/quote] if you do a "var_dump($path)" you get "My Title" instead of the path/to/the/myview, don't you?
[eluser]xwero[/eluser]
Yes the $path value in the loader class was the value from the array. I used different values but with the same path key as you.
[eluser]ralf57[/eluser]
It looks like a bug. I will post it to the bugtracker.
[eluser]coolfactor[/eluser]
I've notified the person in charge of maintaining CI.
[eluser]barbazul[/eluser]
As I mentioned in this topic there are some reserved words in views. Check the loader class and you'll notice that there are some assignments to the $data array. The following are reserved variable names: view vars path return and they should be documented |
Welcome Guest, Not a member yet? Register Sign In |