init.php 建立自己的前端共享文件
文件位置:include/init.php
1.新建文件lib_xxx.php(lib_liangxin.php)
2.在文件init.php 第74行加入代码
require(ROOT_PATH . 'includes/inc_constant.php'); require(ROOT_PATH . 'includes/cls_ecshop.php'); require(ROOT_PATH . 'includes/cls_error.php'); require(ROOT_PATH . 'includes/lib_time.php'); require(ROOT_PATH . 'includes/lib_base.php'); require(ROOT_PATH . 'includes/lib_common.php'); require(ROOT_PATH . 'includes/lib_main.php'); require(ROOT_PATH . 'includes/lib_insert.php'); require(ROOT_PATH . 'includes/lib_goods.php'); require(ROOT_PATH . 'includes/lib_article.php');
require(ROOT_PATH . 'includes/lib_liangxin.php'); // 此行
3.lib_liangxin.php在其他文件就可以使用
<?php /** * ECSHOP 前台公用函数库 * ============================================================================ * * 版权所有 亮星科技 并保留所有权利。 * ---------------------------------------------------------------------------- * 亮星技术开发 * Time : 2016-01-18 * ============================================================================ * $Author: LiangXin */ if (!defined('IN_ECS')) { die('Hacking attempt'); } function tt(){ return '2222'; } ?>