views:

721

answers:

3

I have the following:

'.anchor('','Home').'

and I want to add the following CSS class to it:

class="top_parent"

so that when its rendered in the browser, the code will look something like

<a href="#" class="top_parent">Home</a>

Thanks in advance. Any help is hugely appreciated.

Tom

+2  A: 

You can specify an associative array of attributes for your Anchor. So, for example:

anchor('', 'Home', array('class' => 'top_parent'));

Whitey
+2  A: 
anchor('#', 'Home', array('class' => 'top_parent'));
Raf
+3  A: 

The Codeignitor function is defined as such:

function anchor($uri = '', $title = '', $attributes = '')

I would try sending an array with a class key and value first.

These functions are found inside the \system\helpers\ folder.

NTulip
boy all that time i spend finding the function and two very talented people had answered the question already. Oh well - my answer is here to stay.
NTulip