Skip to content

upper

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