Auto_LInk - how to add a class to the resulting link |
[eluser]JamesTaylor[/eluser]
When using the Auto_Link function of the URL helper what is the best way to incorporate a class with the link that is created? I want to be able to style all Auto_Links in a specific manner via css so I would like to include class="AutoLink" into the output code but there doesn't appear to be an option to do so in the parameters it takes? Anyone else dealt with this issue before? Thanks James
[eluser]Georgi Budinov[/eluser]
Straight from the User guide : Code: echo anchor('news/local/123', 'title="My News"'); so this get like : Code: echo anchor('news/local/123', 'class="autolink"'); Uuups didn't catch what you meant...
[eluser]JamesTaylor[/eluser]
Georgi, i am not using the anchor tag to create links in this instance. I am using the auto_link tag and am wanting to achieve the equivilient to what you have shown.
[eluser]Georgi Budinov[/eluser]
Yes I realized that OK no way as I see the problem! However you can overwrite the function by creating your own my_url_helper updating the code: Code: function auto_link($str, $type = 'both', $popup = FALSE, $customClass = FALSE) Not tested but something like this will help. |
Welcome Guest, Not a member yet? Register Sign In |