Analysis of correlation function usage of thinkphp template arithmetic operation

Source: Internet
Author: User
This article mainly introduced the thinkphp template arithmetic operation correlation function usage, has analyzed the thinkphp about the arithmetic operation and the parameter transfer the correlation skill, needs the friend can refer to the next

In this paper, we describe the usage of thinkphp template arithmetic operation correlation function. Share to everyone for your reference, as follows:

The function is defined as follows:

function You ($num 1,num2) {  echo $num 1* $num 2/100;}

<volist name= "list" id= "Vo" > <tr><td>{$vo. price|you= $vo. Discount '}</td> or: {$vo. price*$ VO.DISCOUNT/100} </tr></volist>

The parameters that are received as write-on are array.discount. The required operation has no correct result.

Modified the code:

<td>{$vo. price|you= $vo [' Discount ']}</td><td>{$vo [' Price ']* $vo [' Discount ']/100}</td>

Both of these methods are available, so you can see that the thinkphp template does not support arithmetic operations and parameter passing of the object pattern.

Related Article

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.