JHTMLImage Problem

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
shi chuan
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Dec 20, 2007 10:09 am

JHTMLImage Problem

Post by shi chuan » Wed Feb 13, 2008 8:21 am

Hi, guys

May I know what's the proper way to use JHTMLImage? The wiki reference is a bit confusing.

One of the example is with the following code:

Code: Select all

echo JHTML::_( 'image.site', 'edit.png', '/images/M_images/', 'save.png', '/images/', 'Save' );

and the output is:

Code: Select all

<img src="images/save.png" alt="Save" align="top" border="0" />


well, let's say if I have an image called 'hulloworld.gif' and it's located at 'joomla_root/images/hullo/', currently I have to use the following code to get the following output:

Code: Select all

echo JHTML::_( 'image.site', 'edit.png', '/images/M_images/', 'hulloworld.gif', '/images/hullo/', 'hullo world');

output:

Code: Select all

<img src="images/hullo/'hulloworld.gif" alt="hullo world" align="top" border="0" />


Is there a way to make this easier? like reduce the parameters like 'edit.png', '/images/M_images/', when I try to leave these parameters empty, the whole function simply won't work.

Thanks in advance!

Post Reply