Message: Undefined variable: css - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Message: Undefined variable: css (/showthread.php?tid=49048) |
Message: Undefined variable: css - El Forum - 02-06-2012 [eluser]jzmwebdevelopement[/eluser] Hey, I am unsure why I am getting the Error: Message: Undefined variable: css in my view. I have checked the user guide and googled I am a bit stumped: Controller: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); View: Code: <!DOCTYPE html> Message: Undefined variable: css - El Forum - 02-06-2012 [eluser]InsiteFX[/eluser] Code: public function index() If that does not fix then It could be a reserved html word, try changing the name and see if it goes away. Message: Undefined variable: css - El Forum - 02-06-2012 [eluser]vincej[/eluser] You appear not to be applying a valid value to $data['css'] in your controller. Message: Undefined variable: css - El Forum - 02-06-2012 [eluser]jzmwebdevelopement[/eluser] [quote author="vincej" date="1328595503"]You appear not to be applying a valid value to $data['css'] in your controller. [/quote] Can you provide an example? Message: Undefined variable: css - El Forum - 02-06-2012 [eluser]InsiteFX[/eluser] I just tried it on my system and it works fine using your directory structure. Unless you are missing your ending body and html tags! Code: <!DOCTYPE html> Message: Undefined variable: css - El Forum - 02-06-2012 [eluser]jzmwebdevelopement[/eluser] [quote author="InsiteFX" date="1328596318"]I just tried it on my system and it works fine using your directory structure. Unless you are missing your ending body and html tags! Code: <!DOCTYPE html> Thanks so much Message: Undefined variable: css - El Forum - 02-07-2012 [eluser]jzmwebdevelopement[/eluser] [quote author="InsiteFX" date="1328596318"]I just tried it on my system and it works fine using your directory structure. Unless you are missing your ending body and html tags! Code: <!DOCTYPE html> Hey, I have tried again on a new install and I can pass Code: $data J Message: Undefined variable: css - El Forum - 02-07-2012 [eluser]InsiteFX[/eluser] Try this: Code: public function index() Message: Undefined variable: css - El Forum - 02-07-2012 [eluser]jzmwebdevelopement[/eluser] [quote author="InsiteFX" date="1328647851"]Try this: Code: public function index() I have tried that with out any luck. Any other ideas, its like its not being seen. Message: Undefined variable: css - El Forum - 02-07-2012 [eluser]CroNiX[/eluser] Um, in your view (header.php), you are trying to echo $text, which you are not passing to the view. Change it to $css, which you ARE passing |