Smarty's variable regulator is a good thing and has been easy to use, but yesterday I found it didn't work.
Copy the codeThe code is as follows:
{$name | upper}
I carefully looked at the manual, looked at the smarty loading path, and checked it up and down for nearly an hour but found no problem. When you are about to fall into a helpless situation, delete the code and rewrite it
Copy the codeThe code is as follows:
{$name|upper}
The result is good. It turns out that after a variable, you should directly follow the vertical line and function name, and there should be no spaces in the middle, otherwise the function of the variable regulator will be invalid. After a long time of trouble, it turned out to be caused by a space, which is not worth it! ! !
It seems that when you adjust the smarty program in the future, you have to pay attention to the space problem. Maybe other problems may also be caused by spaces, and problems caused by spaces are the least easy to detect.