其实没有什么东西,做个记录,方便以后使用!
- {$title}
封装标签示例:
// 定义标签protected $tags = array( 'topcates'=> array('attr'=>'limit'), 'arclist'=> array('attr'=>'mid,cid,row'));
具体方法示例:
public function _arclist($attr,$content){ //调用父类 $mid = isset($attr['mid']) ? $attr['mid'] : '2'; $cid = isset($attr['cid']) ? $attr['cid'] : ''; $row = isset($attr['row']) ? $attr['row'] : '5'; // 组合PHP代码字符串 $str = ' '.$mid.',"category_id"=>'.$cid.');'; $str .= '$_cateArcList = M("document")->where($where)->limit('.$row.')->select();'; $str .= 'foreach($_cateArcList as $v):'; $str .= 'extract($v); ?>'; $str .= $content; $str .= ' '; return $str;}
just so so !