How to put an Image in an Anchor in CodeIgniter
I often see new CodeIgniter users ask, how to put an image inside the anchor helper. Most developers 'hand-code' the image tag inside the anchor helper
<?php
echo anchor('somewhere/out_there/', '<img src="myimage">');
This is the CodeIgniter way
<?php
echo anchor('somewhere/out_there/', img('myimage'));
It's much better to use the CodeIgniter way so that when the time comes to move your site, you won't be required to change your image source on your image tags.
Categories: How To
Tags: codeigniter
1 Comments
napz
Nice one bro. thanks…
I got other question how do you put an anchor in a button type?
April 22nd 2010