How do I connect a variable to a string in Smarty?

Source: Internet
Author: User
Functiona is a custom smarty plug-in that has a parameter URL.
However, the value of the URL consists of the string 1, the variable $onetopic.id, and the string 2.
{Fuctiona url= ' str2{$onetopic. Id}str2 '}

{Fuctiona url= ' str2 '. ' $onetopic. Id '. ' Str2 '}

I tried the above several forms can not! Daniel, teach me a little bit!


Reply to discussion (solution)

{Fuctiona url= "str2{$onetopic. Id}str2"}

Not even.

Change it, divide it into multiple parameters, and change it in the function.

{Fuctiona url= "str2" |cat: $onetopic. Id|cat: "STR2"}

Cat is Smarty string connection function, you try more, long time no smarty

Thanks 4 5 Floor

Baidu found the answer, thanks to LZ share, here to make a mark,
More complex applications:

 
 
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.