🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
### 控制器输出 `return $this->fetch($template); return view($template);` ### 模板里面打印数据`{:dump($info)}` cltphp,部分存在参数冲突,所以需要将参数特别是info重新命名,再将其放置到详情页的自变量中。 ~~~ {volist name="category" id="vo"} <li {if condition="$controller eq $vo['catdir']"}class="selected"{/if}> <a href="{:url('home/'.$vo['catdir'].'/index',['catId'=>$vo['id']] )}" title="{$vo.catname}-">{$vo.catname}</a> {if condition="$vo['child'] eq 1"} <ul> {volist name="$vo.sub" id="v"} <li><a href="{:url('home/'.$vo['catdir'].'/index',['catId'=>$v['id']] )}" title="{$v.catname}-"><span>-</span> {$v.catname}</a></li> {/volist} </ul> {/if} </li> {/volist} ~~~ ~~~ {clt:list_join db='article' dbfield='catid' id='vo' joindb='category' joinfield='id' where="posid = 1" order="listorder asc,createtime desc" limit='4'} <div class="three columns mobile-two"> <h5><a style="{:style($vo['title_style'])}" href="{:url('home/'.$vo['catdir'].'/info',array('id'=>$vo['id'],'catId'=>$vo['catid']))}" title="{$vo.title}">{:str_cut($vo.title,12,'...')}</a></h5> <div class="link-url"> <a href="{:url('home/'.$vo['catdir'].'/info',array('id'=>$vo['id'],'catId'=>$vo['catid']))}" target="_blank" title="{$vo.title}"> <img src="{:imgUrl($vo['title_thumb'],'__HOME__/images/portfolio-thumb/p'.$k.'.jpg')}" alt="{$vo.title}" class="fade" /> </a> </div> </div> {/clt:list_join} ~~~ ~~~ {clt:list db='article' id='vo' where="posid = 1" order="listorder asc,createtime desc" limit='4' key="i"} <div>{$k}、{$vo['title']}</div> {/clt:list} ~~~ ~~~ {clt:list_join db='goods' dbfield='catid' id='vo' joindb='category' joinfield='id' where="posid = 1" order="id desc" limit='4'} {clt:list_join db='goods' dbfield='id,title,catid,thumb,catname' id='vo' joindb='category' joinfield='id' where="status = 1" order="id desc" limit='4'} <li {if condition="$controller eq $vo['catdir']"}class="selected"{/if}> <a href="{:url('home/'.$vo['catdir'].'/index',['catId'=>$vo['id']] )}" title="{$vo.catname}-CLTPHP内容管理系统">{$vo.catname}</a> {if condition="$vo['child'] eq 1"} <ul> {volist name="$vo.sub" id="v"} <li><a href="{:url('home/'.$vo['catdir'].'/index',['catId'=>$v['id']] )}" title="{$v.catname}-CLTPHP内容管理系统"><span>-</span> {$v.catname}</a></li> {/volist} </ul> {/if} </li> {/volist} ~~~ ~~~ SELECT a.id, a.title, a.thumb, b.catname FROM clt_goods a LEFT JOIN clt_category b ON a.catid = b.id; ~~~ ~~~ {clt:list db='product' id='vo' where="catid = 21" order="createtime desc" limit='4'} <li class="col-md-3 col-xs-6 col-sm-3"><a href="{:url('home/'.$vo['catdir'].'/info',array('id'=>$vo['id'],'catId'=>$vo['catid']))}"><img class="img-responsive" src="public{$vo.thumb}" alt=" "></a> <center> <span><a href="{:url('home/'.$vo['catdir'].'/info',array('id'=>$vo['id'],'catId'=>$vo['catid']))}">{$vo.title}</a></span> </center> </li> {/clt:list} ~~~ ~~~ {clt:info db='category' id='info' where=" id = 21"} <li class=" col-lg-3 navline col-sm-3 col-xs-3"><a href="{:url('home/'.$info['catdir'].'/index',['catId'=>$info['id']] )}" >{$info.catname}</a></li> {/clt:info} ~~~ ~~~ $list = Db::table('clt_ad')->alias('a') ->join( 'clt_ad_type at', 'a.type_id = at.type_id', 'left') ->field('a.ad_id,a.name,a.addtime,a.sort,a.open,at.name as typename') ->order('a.sort') ->select(); $this->assign('list',$list); return $this->fetch(); $list = Db::table('clt_news')->alias('a') ->join( 'clt_category at', 'a.type_id = at.type_id', 'left') ->field('a.ad_id,a.name,a.addtime,a.sort,a.open,at.name as typename') ->order('a.sort') ->select(); $this->assign('list',$list); return $this->fetch(); ~~~ ~~~ {volist name="list" id="vo"} <tr> <td>{$vo.ad_id}</td> <td>{$vo.name}</td> <td>{$vo.typename}</td> <td>{:toDate($vo.addtime,'Y-m-d')}</td> <td>{$vo.sort}</td> <td>{if ($vo['open'] eq 1)}开启{else/}禁用{/if}</td> </tr> {/volist} ~~~