
php
文章平均质量分 56
jakieyoung
这个作者很懒,什么都没留下…
展开
-
CodeIgniter系列 添加filter和helper
filter:使用CI的hooks来实现filter.1.在system/application/config/config.php中,把enable_hooks的值改为TRUE $config[enable_hooks] = TRUE;2.在syste/application/config/hooks.php中,添加hooks,如下 $hook[post_contr原创 2010-05-13 10:21:00 · 2421 阅读 · 0 评论 -
CodeIgniter系列 记录count和分页
<br />对于某个表的不带条件的count,可以简单的用<br />$total = $this->db->count_all($table_name)<br />来获取,但是如果有条件,则要用count_all_results<br />$this->db->where('sex', 'M');<br />$this->db->from('user');<br />$total = $this->db->count_all_results();<br /> <br />CI的pagination库可以帮原创 2010-06-02 11:22:00 · 12224 阅读 · 0 评论 -
自己写的PHP的Logger
工作中需要用到php写日志,log4php需要复杂的配置文件,不想去弄。虽然跟log4j的配置差不多,但也没必要去维护一个日志配置文件。就自己写了一个单文件的logger类,只需要include进来使用即可。不多说,贴代码<?php/* * PHP Logger Class * Created: 2011-10-26 * Author: xingfei(http://blo原创 2011-10-26 14:18:35 · 6040 阅读 · 1 评论