Hello,
I have a table with a column called “item_code”.
For each row I must load an image with a different image that depends from “item_code”.
I have tried to get the value of “item_code” with :
$col[“default”] = “<img height=50 src=’http://www.mysite.com/images/”.$row[“item_code”]”‘.jpg>”;
but don’t work because the variable is not set correctly.
Can you help me ?
Thank you
Maurizio
If you have a column $col[“name”] = “item_code” then you can use:
$col[“default”] = “<img height=50 src=’http://www.mysite.com/images/{item_code}.jpg>”;
Before to insert the value {item_code} in the string assigned to $col[“default”] I need to make some operation on the string item_code ( i need to add the extension, to modify a part of the path and to add another string to path )
For this reason I need to have the item_code not inside the string <img …… > but to have it like a normal variable.
I have tried to use $MyPath = {item_code} but if I use $MyPath to add informations to path the variable is always empty.
There is a solution ?
Maurizio
Refer extended conditional content here:
http://www.phpgrid.org/docs/column-options/#conditional-content