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

smarty模板调用php的内置函数

WBOY
Release: 2016-06-06 19:55:42
Original
1573 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 在smarty中调用php的内置函数: 相信很多人都不是很很了解smarty的一个重要功能,就是能在smarty模板里面调用php的内置函数。 模板书写: {'param1'|functionName:'param2':'param3'} php函数原型:

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  在smarty中调用php的内置函数:

  相信很多人都不是很很了解smarty的一个重要功能,就是能在smarty模板里面调用php的内置函数。

  模板书写:

  {'param1'|functionName:'param2':'param3'}

  php函数原型:

  echo functionName('param1','param2','param3');

  实例:

  {'1234567'|substr:'1':'2'}

  下面这个比较怪 和函数的参数顺序有关系

  {'a'|str_replace:'A':'abcd'}

smarty模板调用php的内置函数

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!