Solved

PHP Smarty Template question - how can I apply str_replace function to variable?

Posted on 2009-05-19
2
4,389 Views
Last Modified: 2013-12-13
I'm in the process of dealing with a PHP-based app that uses smarty templates, and I'm trying to figure out how to apply a str_replace() function to one of the variables that I'm encountering in one of the html templates:

{$product->display('product_image')}

This parameter resolves to an image path that I need to somehow change.  

More specifically, .. I need to update this image path using the str_replace() function.  I want to replace the string "/webauction/" with nothing (ie: "").  

How do I do that? is it even possible within a smarty template?

Tanks,
 - Yvan

0
Comment
Question by:egoselfaxis
2 Comments
 
LVL 7

Accepted Solution

by:
ycTIN earned 500 total points
ID: 24428646
0
 

Author Comment

by:egoselfaxis
ID: 24431410
Thanks - that's exactly what I was looking for!

- Yvan
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now