跳至内容

upper

这用于将变量大写。这等效于 PHP strtoupper() 函数。

基本用法

{$myVar|upper}

示例

<?php
$smarty->assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");

模板所在位置

{$articleTitle}
{$articleTitle|upper}

将输出

If Strike isn't Settled Quickly it may Last a While.
IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.

参见 lowercapitalize