Welcome Guest, Not a member yet? Register   Sign In
New url_helper anchor tag that allows for an image link
#1

[eluser]InsiteFX[/eluser]
A lot of people on the forums have been asking how to create an anchor with an image
so here you go.

Can use as a normal anchor tag or pass in an image.
Save code to application/helpers/MY_url_helper.php

Download MY_url_helper

#2

[eluser]CroNiX[/eluser]
I like that. You should request a pull.
#3

[eluser]Paleleaves[/eluser]
Really helpful..This is what exactly I'm looking for.. thank you!
#4

[eluser]piddleton[/eluser]
Howdy, I'm a CI newb and found this thread on a search.

Will this function allow you to anchor an image with an href while not showing the anchor text?

I have the anchor function working with an image, but I can't seem to get the link text to disappear. Tried removing the 2nd parm and using blank quotes in the anchor function but to no avail.

#5

[eluser]InsiteFX[/eluser]
give me a few minutes and I will add that options to it!

UPDATED: 2012-05-22

Added new flag for imgage only link.
Code:
$img_only = TRUE/FALSE

Set to TRUE for just an image link tag

Re-download from link above!
#6

[eluser]piddleton[/eluser]
Wow, thanks so much!! :-)
#7

[eluser]InsiteFX[/eluser]
Please let me know if that is working the way you want or if you need anything else added to.
#8

[eluser]piddleton[/eluser]
[quote author="InsiteFX" date="1337710272"]Please let me know if that is working the way you want or if you anything else added to.
[/quote]

It worked beautifully! At first CI couldn't find the function because I erroneously put it in the system/helpers folder instead of application/helpers.

So I guess any custom helper functions need to go in application/helpers? Is that customizeable in any of the config files? Just curious how CI knows to go there...

Thanks again!!
#9

[eluser]CroNiX[/eluser]
Basically, you should never have to touch the /system directory. Everything outside of the stock CI having to do with your application goes in /application.
#10

[eluser]piddleton[/eluser]
[quote author="CroNiX" date="1337713083"]Basically, you should never have to touch the /system directory. Everything outside of the stock CI having to do with your application goes in /application.[/quote]

Got it, thanks for the clarification.




Theme © iAndrew 2016 - Forum software by © MyBB