home-code

示例❤源码


<!DOCTYPE html><html><head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no'>
<title>标签函数</title>
<meta name='robots' content='noindex, nofollow'>
<style type="text/css">
    h2{ margin-top:1rem !important; }
    .cF00{ color:#F00; display:inline-block; padding:0.2rem; border:1px solid #CCC; }
</style>
</head><body> 


<h2>Url输出</h2>

{surl(0)} : Demo首页 <br>
<?=vopUrl::fout(0)?> : Demo首页 <br>
{surl(book:0)} : 文档首页<br>

{surl(tptag-tagf);} :标签函数 - 文档<br>
{surl(demo:tptag-tagf);} :标签函数 - Demo<br>

{surl(tptag-tagf,0,1);} :标签函数 - 文档 - 完整地址<br>
{surl(demo:tptag-tagf,0,1);} :标签函数 - Demo - 完整地址<br>

{surl(xgroup:ymod)} :无效链接 (xgroup组无效)<br>
{surl(ymod)} :自定义模型链接 <br>

{surl(news.2016-12-abcd)} //详情地址<br>
{surl(news.2016-34-eeff)} //详情地址 <br>


<h2>多语言标签</h2>
<p>core-cn.sms_errtel : <?=lang('core.sms_errtel')?></p>


<h2>类别选项</h2>
<?php
    $split 
'|';
    
$tpl "<span class='itm-(k) cF00'>(v)</span>";
    
$null '';
?>
<p>cargo栏目-baext:{sopt(baext,cargo,0,$null)} //默认自动彩色显示 </p>
<p>cargo栏目-cosys:{sopt(cosys,cargo,0,$null)} //默认自动彩色显示 </p>
<p>cargo栏目-ouapi:{sopt(ouapi,cargo,0,$null)} //默认自动彩色显示 </p>
<p>cargo栏目-xelse:{sopt(xelse,cargo,0,$null)} //默认自动彩色显示 </p>

<p>多个选项-cosys+ouapi:{sopt(cosys+ouapi,cargo,0,$null)} //多个选项 </p>
<p>模版显示-cosys+ouapi:{sopt(cosys+ouapi,cargo,$tpl,$null)} //多个选项 </p>

<p>china-cnhn:{sopt(cnhn,china,$tpl,$null)} //china类别选项 </p>
<p>china-cngd:{sopt(cngd,china,$tpl,$null)} //china类别选项 </p>

<p>cargo.fixsys字段属性-imcat:{sopt(imcat,cargo.fixsys,0,$null)} //cargo.fixsys字段属性 </p>
<p>cargo.fixsys字段属性-imblog:{sopt(imblog,cargo.fixsys,0,$null)} //cargo.fixsys字段属性 </p>
<p>cargo.fixsys字段属性-ourhouse:{sopt(ourhouse,cargo.fixsys,0,$null)} //cargo.fixsys字段属性 </p>


<h2>图片/标题</h2>
<?php
    $img1 
'{staticroot}/media/collect/xditu.jpg';
    
$img2 '';
    
$v = ['title'=>'长标题1长标题2长标题3长标题4长标题5长标题6','color'=>'CC33FF']
?>
<p>
    {spic($img1,demo_120x90.jpg,120x60)} <br>
    <img src="{spic($img1,demo_120x90.jpg,120x60)}">
    <img src="{spic($img2,demo_120x90.jpg,120x60)}">
</p>
<p>
    {title($v['title'],12,$v)}
</p>


<!--h2>(富)文本</h2-->


<h2>时间输出</h2>
<?php
$stamp 
time();
$time1 $stamp 12345;
$time2 $stamp 4*86400 67809;
$time3 $stamp 12*86400;
$time4 $stamp 24*86400;
?>
<p>{=$stamp}:{stime($stamp)} //默认-1天内 </p>
<p>{=$time1}:{stime($time1)} //默认-1天内 </p>
<p>{=$time2}:{stime($time2)} //默认-1周内 </p>
<p>{=$time3}:{stime($time3)} //默认-1周外 </p>
<p>{=$time4}:{stime($time4)} //默认-1周外 </p>
<p>{=$stamp}:{stime($stamp,d)} //d参数</p>
<p>{=$stamp}:{stime($stamp,Y-m-d)} //Y-m-d参数 </p>
<p>{=$stamp}:{stime($stamp,min)} //min参数 </p>
<p>{=$stamp}:{stime($stamp,full)} //full参数 </p>
<p>{=$stamp}:{stime($stamp,dm)} //dm参数 </p>

</body></html>

-End-