Smarty变量调节器失效的解决办法,smarty变量调节器
Smarty的变量调节器是个不错的东西,一直以来都用着顺手,可昨天使用变量调节器时发现不管用。
复制代码 代码如下:
{$name | upper}
仔细看了手册,看了smarty加载路径,上上下下检查了将近一个小时也没有发现问题所在。即将要陷入无奈的困境时,把代码删除了重新写成
复制代码 代码如下:
{$name|upper}
结果好了。原来是变量后要直接跟着竖线,函数名,中间不能有空格,否则变量调节器的功能将失效。闹了半天,原来就是一个空格引起的,太不值当了!!!
看来以后调smarty程序,得注意空格问题~,说不定其它问题也可能是空格引起的,而空格引起的问题最不容易发现。
两种没区别的
很简单啊,你看一下Smary模板手册就知道了!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools