smarty 模版参数中的变量使用及变量的运算
2012-11-05 10:01
337 查看
SYNTAX EXAMPLES: {func var="test $foo test"} <-- sees $foo {func var="test $foo_bar test"} <-- sees $foo_bar {func var="test $foo[0] test"} <-- sees $foo[0] {func var="test $foo[bar] test"} <-- sees $foo[bar] {func var="test $foo.bar test"} <-- sees $foo (not $foo.bar) {func var="test `$foo.bar` test"} <-- sees $foo.bar PRACTICAL EXAMPLES: {include file="subdir/$tpl_name.tpl"} <-- will replace $tpl_name with value {cycle values="one,two,`$smarty.config.myval`"} <-- must have backticks
{$foo+1} {$foo*$bar} {* some more complicated examples *} {$foo->bar-$bar[1]*$baz->foo->bar()-3*7} {if ($foo+$bar.test%$baz*134232+10+$b+10)} {$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"} {assign var="foo" value="`$foo+$bar`"}
限定符"`"值得关注
相关文章推荐
- php smarty模版引擎中变量操作符及使用方法
- php中smarty模版引擎中常用的20个变量操作符及使用方法!
- php smarty模版引擎中变量操作符及使用方法
- php smarty模版引擎中变量操作符及使用方法
- smarty模版使用php标签,获取模版变量!
- php smarty模版引擎中变量操作符及使用方法
- smarty模版使用php标签,如何获取模版变量
- 模版获取多层次节点(使用不定参数)
- mysql 存储过程中 limit之后使用分页变量,传入分页参数. 类似于微博游标分批次获取信息;问号参数类似于c#的string.format;问号占位符
- 结构变量作为方法的参数调用,在方法内部使用的“坑”你遇到过吗?
- SMARTY模板中如何使用get,post,request,cookies,session,server变量
- 【深入浅出WF】——活动参数与变量的使用
- SpringMVC 在业务控制方法中写入模型变量收集参数,且使用@InitBind来解决字符串转日期类型
- PHP模板引擎Smarty之配置文件在模板变量中的使用方法示例
- spring boot 使用thymeleaf模版传递变量control内的响应路径不能使用@getpaing注解
- SSRS----报表表达式、参数、变量使用
- 给定一个10位的整数组成的串,形式如: d1d2d3d4d5d6d7d8d9d10 。 其中最后的一位(即 )是校验和,其使用以下运算规则以前面的9位上的整数作为参数获得结果
- 隐藏变量的使用-前后台参数的传递控制。
- 在blade中定义一个可以被模版使用的变量
- smarty中的变量使用