default[默认值]

default[默认值]

test.php:

$smarty = new Smarty;
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty->display('test.html');

test.html:
{$articleTitle|default:"no title"}
{$myTitle|default:"no title"}

输出:
Dealers Will Hear Car Talk at Noon.
no title

继续学习
||
<?php echo "default[默认值]";
提交重置代码
  • 推荐课程
  • 评论
  • 问答
  • 笔记
  • 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~