Home > php教程 > php手册 > body text

Smarty变量调节器失效的解决办法

WBOY
Release: 2016-06-06 20:19:12
Original
1602 people have browsed it

这篇文章主要介绍了Smarty变量调节器失效的解决办法,这可以说是一个空格引发的备案,害的我郁闷了半个小时,特此分享,需要的朋友可以参考下

Smarty的变量调节器是个不错的东西,,一直以来都用着顺手,可昨天使用变量调节器时发现不管用。

复制代码 代码如下:


{$name | upper}


仔细看了手册,看了smarty加载路径,上上下下检查了将近一个小时也没有发现问题所在。即将要陷入无奈的困境时,把代码删除了重新写成

复制代码 代码如下:

{$name|upper}

结果好了。原来是变量后要直接跟着竖线,函数名,中间不能有空格,否则变量调节器的功能将失效。闹了半天,原来就是一个空格引起的,太不值当了!!!

看来以后调smarty程序,得注意空格问题~,说不定其它问题也可能是空格引起的,而空格引起的问题最不容易发现。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!