Welcome Guest, Not a member yet? Register   Sign In
Need help reagrding image as anchor
#1

[eluser]handoyo[/eluser]
Hi all,i try the following code

Code:
echo anchor('admin/conf/edit/'.$list['id'],'<img src="'.base_url().'/img/Edit.gif" width="32" height="32"/>',array('title' => ''));

I got it from Image as anchor

It doesn't show the images instead only grey colour..

error
#2

[eluser]bigtony[/eluser]
Personally I use the CI img function so it works out he relative path itself:
Code:
echo anchor("controler/function/{$param}", img(array('src' => 'path/to/image.gif', 'alt' => "Some alt text")));
#3

[eluser]handoyo[/eluser]
I've tried it bigtony.I use it like this

Code:
echo anchor("admin/conf/edit/".$list['id'],img(array('src' => 'img/Edit.gif', 'alt' => "Edit")));

It gives me error
Code:
Fatal error: Call to undefined function img() in D:\xampp\htdocs\7com\system\application\views\admin\store_config_home.php on line 34

Thanks..
#4

[eluser]bigtony[/eluser]
You need to load the helper for it!!!
Code:
$this->load->helper('html');
#5

[eluser]handoyo[/eluser]
Oops....I've setup in the autoload,it shows Edit with border only..Thanks..




Theme © iAndrew 2016 - Forum software by © MyBB