dede的万能标签好厉害,这里也弄个
之前在论坛中也发过,现在在这里也发个,比上次的版本添加了,缓存,调试,field等..
foo是什么意义通俗点就是无法识别,一塌糊涂的意思,就是没意义。
这个没意义好有万能的意味,姑且使用foolist吧。
至于万能标签的意义呢,懒人必备,cms必备啊
官方的volist是要在action中定义数据来源的,foolist就厉害了,无需定义鸟:
foolist也是一个CX标签,
修改Lib\Driver\TagLib\TagLibCx.class.php
添加标签定义://一下为自定义
'foolist' => array('attr'=>'model,where,order,num,id,page,pagesize,query,flag,field,cache','level'=>3), //万能的输出标签好了下面是foolist 的内容//'foolist'=>array('attr'=>'model,where,order,num,id,page,pagesize,query,flag,debug','level'=>3), //万能的输出标签
public function _foolist($attr,$content)
{
$html='';
$tag = $this->parseXmlAttr($attr,'foolist');
$model =!empty($tag['model'])?$tag['model']:'';
$order =!empty($tag['order'])?$tag['order']:'';
$num =!empty($tag['num'])?$tag['num']:'';
$id =!empty($tag['id'])?$tag['id']:'d';
$where =!empty($tag['where'])?$tag['where']:'';
//使where支持 条件判断,添加不等于的判断
$this->comparison['noteq']= '<>';
$this->comparison['sqleq']= '=';
$where =$this->parseCondition($where);
$page=false;
if(!empty($tag['page'])) $page=$tag['page'];
if($page=='ture') $page=false;
$pagesize =!empty($tag['pagesize'])?$tag['pagesize']:'10';
//是否用缓存,默认是false
$cache =!empty($tag['cache'])?$tag['cache']:false;
$query =!empty($tag['query'])?$tag['query']:'';
$field =!empty($tag['field'])?$tag['field']:'';
$debug =!empty($tag['debug'])?$tag['debug']:false;
//使query 支持条件判断
$query =$this->parseCondition($query);
if($where!='') $where.=' and '.$flag;
$html.=' ". $p->show ()."