CodeIgniter 中公共函数不能追加,可以通过 helper 辅助函数实现。
创建 common_helper.php 文件,定义所需公共函数,存放至 application/helpers 目录中。
common_helper.php
application/helpers
在 application/config/autoload.php 中配置 $autoload[‘helper‘] = array(‘common‘); 即可。
application/config/autoload.php
$autoload[‘helper‘] = array(‘common‘);
CodeIgniter 引入自定义公共函数
原文:http://www.cnblogs.com/whlives/p/4125739.html