sample1
Copy code The code is as follows:
<{$colname|trim}>
How to write if you use a function with three parameters like iconv? If written as:
sample 2
Copy code The code is as follows:
<{$colname|iconv:'utf -8':'gbk'}>
Once executed, an error message will be displayed.
Therefore, if you study it, you will find that starting from the application function usage on the smarty template page, taking smaple 1 as an example, $Row->colname in front of trim is actually the first parameter of trim, and | is used in the middle Symbol concatenation;
If you want to use a function like iconv with three parameters, you must write:
sample 3
Copy code Code As follows:
<{'utf-8'|iconv:'gbk':$colname}>
is the first parameter of the
function |Function: second parameter: third parameter. In sample 3, the value of colname will be converted from utf-8 format to gbk.
http://www.bkjia.com/PHPjc/323258.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323258.htmlTechArticlesample1 Copy the code as follows: {$colname|trim} Then if you use a function with three parameters like iconv How to write it? If written as: sample 2 Copy the code The code is as follows: {$co...