passing data to the view |
[eluser]strattonbrazil[/eluser]
By the way, I don't think the file attached correctly the first time. The view should be attached now in a zip file.
[eluser]strattonbrazil[/eluser]
Could this have anything to do with the routing options I've setup? Right now when I type in http://localhost/project/dashboard it changes to localhost/project/dashboard Is that a possible problem? This whole passing-date-to-the-view seems to be pretty fundamental to me using codeigniter. ![]()
[eluser]strattonbrazil[/eluser]
I downloaded a new version of codeigniter and replaced just the views and controllers (and the default controller), and I get the same error, so I don't believe it's a routing thing I've done. Could it be something in my LAMP configuration?
[eluser]Nick_MyShuitings[/eluser]
Your computer, or some ancestors... hate you. Thats the only explanation. In seriousness, that is very weird, and completely un-reproducible... What lamp stack are you working on? XAMP? WAMP? Linux native? that shouldn't have anything to do with it, since this is literally just passing an array...
[eluser]strattonbrazil[/eluser]
[quote author="Nick_MyShuitings" date="1294466361"]Your computer, or some ancestors... hate you. Thats the only explanation. In seriousness, that is very weird, and completely un-reproducible... What lamp stack are you working on? XAMP? WAMP? Linux native? that shouldn't have anything to do with it, since this is literally just passing an array...[/quote] LAMP. How exactly is it passed? I've seen examples where they're passing three parameters to view. What's that all about?
[eluser]Cristian Gilè[/eluser]
It's a very bad practice putting functions inside view. Here, a more elegant solution: in your controller: Code: class Dashboard extends Controller { in your view: Code: <div id="navigation-bg">
[eluser]strattonbrazil[/eluser]
Okay, I'll do that. I did figure out the problem. The variable was being passed, but was outside the scope of the function. I realized it when I swapped out the function for just $controller_name and it worked, so I looked up PHP scoping (since I haven't done PHP in years). |
Welcome Guest, Not a member yet? Register Sign In |