posted @ 2015-03-01 15:59 SmarTom 阅读(102) 评论(0) 推荐(0)
posted @ 2015-02-16 13:05 SmarTom 阅读(323) 评论(0) 推荐(0)
|
摘要:
1.创建视图模型2.定义视图模型class BlogViewModel extends ViewModel { public $viewFields = array( 'Blog'=>array('id','name','title'), 'Category'=>array('t... 阅读全文
posted @ 2015-02-16 13:05 SmarTom 阅读(323) 评论(0) 推荐(0)
摘要:
1.S方法缓存设置if(!$rows = S('indexBlog')){ //*$rows = S('indexBlog') $rows = D('blog')->select(); S('indexBlog',$rows,10);}$this->assign('rows',... 阅读全文
posted @ 2015-02-16 12:30 SmarTom 阅读(702) 评论(0) 推荐(0)
摘要:
'URL_ROUTER_ON' => true, //开启路由2.定义路由1 'URL_ROUTE_RULES' => array(2 '/^c_(\d+)$/' => 'Index/List/index?id=:1'3 ),3.Apache去掉index.php 1、http... 阅读全文
posted @ 2015-02-15 22:06 SmarTom 阅读(233) 评论(0) 推荐(0)
摘要:
1.定义TagLib目录和文件 TagLibSmarTop.class.php2.配置文件'@.TagLib', //TagLib的位置 @.表示当前文件夹下 'TAGLIB_BUILD_IN'=>'Cx,SmarTop' //Cx是thinkphp基础类库的名称必须引... 阅读全文
posted @ 2015-02-15 21:55 SmarTom 阅读(287) 评论(0) 推荐(0)
摘要:
1.json处理中文字幕(0.0)1 foreach($row as $k=>$v){2 $row[$k]['title'] = urlencode($v['title']);3 }4 echo $json_arr = urldecode(json_encod... 阅读全文
posted @ 2015-02-11 14:02 SmarTom 阅读(101) 评论(0) 推荐(0)
摘要:
1.定义关联模型2.使用关联模型D('BlogRelation')->relation(true)->add($data); 阅读全文
posted @ 2015-02-06 22:50 SmarTom 阅读(120) 评论(0) 推荐(0)
摘要:
1.引入Ueditor 1 2 10 11 12 13 2.加入水印处理类 (随便找了一个) 1 $waterType = 1; //类型:0为文字水印、1为图片水印 9 * $obj->$transparent = 45; //水印透明度 1... 阅读全文
posted @ 2015-02-06 16:27 SmarTom 阅读(801) 评论(0) 推荐(0)
摘要:
1.insert into smar_attr select id+1,concat('st',id+1),'#1112fasd1' from smar_attr order by id DESC limit 1例如 需求: ID 其他字段 id20150207001 X... 阅读全文
posted @ 2015-02-05 10:03 SmarTom 阅读(181) 评论(0) 推荐(0)
摘要:
1 require_once(DEDEINC."/arc.listview.class.php");2 $lv = new ListView($tid); //传入ID;3 MfTypedir($lv->Fields['typedir']); //获取要生成到的文件目录4 //直接生成5 $reur... 阅读全文
posted @ 2015-02-02 17:23 SmarTom 阅读(274) 评论(0) 推荐(0) |
||