Solved

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

Posted on 2009-05-19
2
4,413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

730 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