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.
class MyController extends Controller
$data = array(
'title' => 'My Title',
'path' => 'My Title',
'heading' => 'My Heading',
'message' => 'My Message'
If in the passed array there is a key named “path” the view is not loaded at all
throwing this warning:
A PHP Error was encountered
Message: CI_Loader::include(My Title) [function.CI-Loader-include]: failed to open stream: No such file or directory
Line Number: 652
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?
PHP Version 5.2.1