CodeIgniter Forums
anchor tag inside form_label - 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: anchor tag inside form_label (/showthread.php?tid=51235)



anchor tag inside form_label - El Forum - 04-25-2012

[eluser]zgames[/eluser]
this is what I want to do:
Code:
<label><a href="">Text1</a>Text2</label>

my setup:

Code:
$anchor = anchor(
'/bla/blah/',
'more text',
$variable
);

Code:
&lt;?php echo form_label('some text', $another_variable, $anchor); ?&gt;

this is what I get:

Code:
<label>some text</label>

any advice?


anchor tag inside form_label - El Forum - 04-25-2012

[eluser]CroNiX[/eluser]
Yes, you are supplying the wrong parameters to form_label(). Where you are putting $anchor as the 3rd parameter is not correct as that is for extra parameters, like setting a classname or id. The first parameter is where anchor should be going (along with any other text) as that is the text that gets displayed in the <label>. The 2nd parameter is for the "name" of the label. See the userguide for more details on how to use it.