Solved

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

Posted on 2009-05-19
2
4,398 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
calculated column 12 74
.php tree directory? 5 56
Should I use subdomains or addon domains? 3 37
PHP: Insert Data into MySQL 5 17
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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 …

867 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

16 Experts available now in Live!

Get 1:1 Help Now