문제

This is what I have:

echo tep_image(DIR_WS_IMAGES . "arText.png", "ALTERNATE TEXT HERE");

The output is this:

img src="THIS-IS-THE-IMAGE-LOCATION" alt="ALTERNATE TEXT HERE" title="ALTERNATE TEXT HERE"

My question is that I want to add WIDTH & HEIGHT of the image in tep_image function in OSCommerce. So the new output would be like this:

img src="THIS-IS-THE-IMAGE-LOCATION" alt="ALTERNATE TEXT HERE" title="ALTERNATE TEXT HERE" WIDTH="Sizepx" HEIGHT="Sizepx"
도움이 되었습니까?

해결책

You just need to pass width and height as extra parameters to tep_image() function, the function already support them. From documentation:

tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') X-Ref
The HTML image wrapper function

So it will look like

echo tep_image(DIR_WS_IMAGES . "arText.png", "ALTERNATE TEXT HERE", "width_here", "height_here");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top