CodeIgniter Forums

Full Version: anchor tag inside form_label
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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?

El Forum

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.