Wrox Programmer Forums
|
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2009, 11:33 AM
Authorized User
 
Join Date: Sep 2009
Posts: 22
Thanks: 2
Thanked 0 Times in 0 Posts
Default image as anchor

Hi all,does anyone ever before make an image as a link?
I try it like this
PHP Code:
 echo '<a href="admin/conf/edit"><img src="../img/Edit.jpg"></a>'
It only shows small grey box like here:

error

Thanks a lot..
 
Old October 9th, 2009, 07:08 AM
Wrox Author
 
Join Date: May 2008
Posts: 53
Thanks: 0
Thanked 5 Times in 5 Posts
Default use the img() helper

make sure you load the HTML helper, then use br() like this:

Code:
echo img('/image/src/foo.gif');
http://codeigniter.com/user_guide/he...elper.html#img

If you need to use it as part of an anchor:

Code:
echo anchor('/controller/whatever/hello',img('/src/foo/bar/hello.gif'));
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
 
Old October 9th, 2009, 09:57 AM
Authorized User
 
Join Date: Sep 2009
Posts: 22
Thanks: 2
Thanked 0 Times in 0 Posts
Default Thanks

Ok,i'll try it myerman..
 
Old October 9th, 2009, 10:37 AM
Authorized User
 
Join Date: Sep 2009
Posts: 22
Thanks: 2
Thanked 0 Times in 0 Posts
Default Doesn't work

Hi myerman,i've tried it.It still only shows grey box..
I use this code
Code:
echo anchor("admin/conf/edit/".$list['id'],img(base_url().'/image/edit.jpg'));
Thanks..
 
Old October 9th, 2009, 11:03 AM
Authorized User
 
Join Date: Sep 2009
Posts: 22
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi myerman,i got it work..It seems that i can't use the image/img folder to hold the pictures.I change the folder name to images,and it works.Thanks a lo.. ^_^





Similar Threads
Thread Thread Starter Forum Replies Last Post
Anchor Tag kapilmirchi ASP.NET 1.0 and 1.1 Basics 2 November 18th, 2008 05:57 AM
onClick and go to anchor #something Parabolart Javascript 7 November 28th, 2006 06:45 AM
anchor and get variables. SignalFade Beginning PHP 4 January 19th, 2006 08:56 PM
Problem with input type image With Anchor tag vinkumrect Javascript How-To 1 July 21st, 2005 08:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.