CodeIgniter Forums
anchor tag inside form_label - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: anchor tag inside form_label (/thread-51235.html)

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

this is what I want to do:
<label><a href="">Text1</a>Text2</label>

my setup:

$anchor = anchor(
'more text',

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

this is what I get:

<label>some text</label>

any advice?

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

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.