![]() |
[solved] howto include anchor within normal $data-array - 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: [solved] howto include anchor within normal $data-array (/showthread.php?tid=4026) |
[solved] howto include anchor within normal $data-array - El Forum - 11-03-2007 [eluser]UnrealMinds[/eluser] I have a view where I want to include dynamic - over the controller defined - links. the following works fine: controller: $data['links'] = '<a href="./impress">Impress</a> | <a href="./test">test</a> '; view: <?=$links?> but I would like to use the "anchor"-function. the following doesn't work: controller: $data['links'] = "<?=anchor('impress', 'Impress')?> | <?=anchor('test', 'test')?>"; How can I do that? ;-) [solved] howto include anchor within normal $data-array - El Forum - 11-03-2007 [eluser]mironcho[/eluser] Try this: Code: $this->load->helper('url'); [solved] howto include anchor within normal $data-array - El Forum - 11-03-2007 [eluser]UnrealMinds[/eluser] cool - thanx! ;-) [solved] howto include anchor within normal $data-array - El Forum - 11-03-2007 [eluser]Majd Taby[/eluser] UnrealMinds - the reason that doesn't work is because <?=anchor('foo','bar'); ?> is equivalent to <?php echo anchor('foo','bar'); ?>. So two things, first of all, when you're in php code (within <?php and ?> ![]() [solved] howto include anchor within normal $data-array - El Forum - 11-03-2007 [eluser]UnrealMinds[/eluser] thanx for this description - I understand now |