![]() |
After exploding array, only one variable is accesible from a view. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: After exploding array, only one variable is accesible from a view. (/showthread.php?tid=7208) |
After exploding array, only one variable is accesible from a view. - El Forum - 03-29-2008 [eluser]guischarf[/eluser] Hello, I just finished installing C.I. for the first time. I tried one of the examples in the documentation, but, when passing an array to the view, only one of the array members is accessible from the view. This is the code: The controller: Code: <?php The view: Code: <html> In this example, only the first member of the array is shown. The second produces the following error: Code: <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> If I invert the members of the array as this: Code: $data['heading'] = "My Real Title"; Then I get: Code: <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> I installed CI 1.6.1 under windows xp sp2, php 5.2.5, apache 2.2.6. Any ideas what could be happening ? Thanks. After exploding array, only one variable is accesible from a view. - El Forum - 03-29-2008 [eluser]Pascal Kriete[/eluser] At first glance this looks just fine. Two things that strike me as odd: you have <? .... ?> tags around your entire view. And you're calling blogview, but the error comes back with blog_view. After exploding array, only one variable is accesible from a view. - El Forum - 03-29-2008 [eluser]guischarf[/eluser] Hello inparo. Sorry, those were there by mistake. They are not in my code. Fixed the examples. Thanks. After exploding array, only one variable is accesible from a view. - El Forum - 03-29-2008 [eluser]adamp1[/eluser] How come both line numbers for the errors are the same? There isn't a title variable declared on line 5 of the view file? After exploding array, only one variable is accesible from a view. - El Forum - 03-29-2008 [eluser]guischarf[/eluser] Hello, Restarted php and is now working. Thanks everyone. |