php - 1 Image URL saved on database (but different versions available on the main server): how to replace a letter on the fly to avoid image scaling? -


this situation: have supplier gives me 1 url image catalogue...for example large version is: http://www.domain.com/dev/1/1/08973911/l_08973911.jpg image url on database saved field: supplier_reference ... can call img src with:

<img src="{$product.supplier_reference|escape:'htmlall':'utf-8'}" width="150" height="133" /> 

and ok 'cause scales... don't want scale. sometimes, in case, don't need large version kind of small 150x133... correct url need be: http://www.domain.com/dev/1/1/08973911/s_08973911.jpg s version. how can replace letter url taken db? thank much.

it seems using smarty. if so, can use smarty's replace variable modifier:

<img src="{$product.supplier_reference|replace:'/l_':'/s_'|escape:'htmlall':'utf-8'}"  width="150" height="133" /> 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -