You are not logged in.
look at this:
{assign var="file" value="test.img"}
{assign var="path" value="/media/$file"}this does not work, {$path} is "/media/".
otherhand this works:
{assign var="file" value="test.img"}
{assign var="path" value="/media/x$file"}{$path} is now "/media/xtest.img".
maybe a problem with /$ ?
Offline
This is because it assumes /$var means there is a division such as : $var/$var, so it doesn't parse it. I am not sure what to do with this honestly. It works if you do value="/media/`$file`" (as it delimits the variable).. But at the same time it sucks a bit having to do that, and I'm not sure it's worth it to allow such constructs in strings, since it is most likely to end up in a WTF than anything else.
Besides, should you really need the math, you could do value=cat("/media/" $file/$whatever), so yes I think I'll just remove it..
Offline
Hm - can't you just check for "" and do _no_ math in there? I mean math would be written as {assign value=12/$x} or am i wrong?
if i have a variable inside of a "" string that can't be math... hmm... sounds strange :-D
besides of that, i can live with the special quoting.
Offline
Well I've just checked Smarty's doc about it, it is allowed in strings but only when the entire math is delimited with ``, so in your case it would work since you don't want math, and should you want it in a string (although I can't think of any really good reason but I'm sure someone would) you can using `$var/$var2` - sounds sane enough and I'd rather remain compatible with Smarty as much as possible, so I will try to rewrite the var parsing in strings to fix this, and meanwhile yes go for the `backticks`, it shouldn't break once I fix it so that's fine.
Offline