Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Help me with variables

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
kichan28
Smarty n00b


Joined: 11 Aug 2018
Posts: 1

PostPosted: Sat Aug 11, 2018 11:11 pm    Post subject: Help me with variables Reply with quote

Hello, I have a question regarding how to use Smarty, I am new to this.
I have problems with environment variables

I would like to know how to carry out one variable within another, example

Code:
{$decimalamount->price('.{$data.price}.')}


where
Quote:
$decimalamount->price()
is a function and
Quote:
$data.price
is the result of the database

How do I put the result of one variable into another?

I try
Code:

{$price = $data.price}
{$decimalamount->price('{$price}')}


I keep generating more error
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sun Aug 12, 2018 7:28 am    Post subject: Reply with quote

You're overcomplicating it.

Code:
{$decimalamount->price($data.price)}
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP