Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-05-19
2
Medium Priority
?
4,432 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 2000 total points
ID: 24428646
0
 

Author Comment

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

- Yvan
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
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.

721 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