Message: Undefined variable: meta - 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: meta (/showthread.php?tid=22327) Pages:
1
2
|
Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]doubleplusgood[/eluser] Hi there, I'm attempting to use the HTML Helper to add meta tags to my view. However, the page is reporting the following error; Quote:A PHP Error was encountered My welcome.php controller looks like this; Code: <?php And at the head of my welcome_message.php view looks like this; Code: <?php echo doctype('html5'); ?> I would be grateful if someone could point out the (probably obvious) error that I'm making. Thanky. Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]SitesByJoe[/eluser] Are you sure you loaded the helper? It's not loaded by default. Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]doubleplusgood[/eluser] Heya, Yes, the helper is loaded in the autoload.php; Code: $autoload['helper'] = array('html'); Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]SitesByJoe[/eluser] And I don't supposed there's any chance that something else stupid is happening, like wrong permissions on the helper file, you've checked the logs to se if they're showing any clues.... that sure is weird. Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]doubleplusgood[/eluser] The helper does seem to be working because it is putting the html5 doctype into the view. There just seems to be an issue with the meta and link variables. :S Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]SitesByJoe[/eluser] Hmmm...everything looks fine. Looks like you need to try a couple simple tests to make sure the meta and link functions work AT ALL... Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]LuckyFella73[/eluser] Did you try to load the view file after declaring the two arrays? I use to load my views this way: Code: $this->load->view('view_example', $data); I'm not sure if the view file is able to "see" your arrays the way you are loading the view. Maybe you have to assign the arrays to a $data array and load the view like wiritten on top of this post. Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]doubleplusgood[/eluser] The meta function seems to work if i just do the following in the view; Code: <?php echo meta('description', 'My Great site'); ?> but fails when I do this; Code: <?php echo meta($meta); ?> Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]doubleplusgood[/eluser] [quote author="LuckyFella73" date="1252181655"]Did you try to load the view file after declaring the two arrays?[/quote] Tried that too, but seemingly the same problem. Message: Undefined variable: meta - El Forum - 09-05-2009 [eluser]LuckyFella73[/eluser] I didn't test this, but maybe this works Code: <?php |