php框架

 首页 > php框架 > ThinkPHP > thinkphp 项目入口文件及项目前台和后台公用配置

thinkphp 项目入口文件及项目前台和后台公用配置

分享到:
【字体:
导读:
          公用配置文件:?phpreturnarray( 39;DB_TYPE 39;= 39;mysql 39;, 数据库类型 39;DB_HOST 39;= 39;localhost 39;, 服务器地址...

thinkphp 项目入口文件及项目前台和后台公用配置文件

公用配置文件:

  1. return array
  2.  'DB_TYPE'               => 'mysql',     // 数据库类型 
  3.  'DB_HOST'               => 'localhost'// 服务器地址 
  4.  'DB_NAME'               => 'aaasearch',          // 数据库名 
  5.  'DB_USER'               => 'root',      // 用户名 
  6.  'DB_PWD'                => 'root',          // 密码 
  7.  'DB_PORT'               => '3306',        // 端口 
  8.  'DB_PREFIX'             => '',    // 数据库表前缀 
  9.  'SESSION_AUTO_START'    => 'true'
  10.  'URL_MODEL'             => 0, 
  11. ); 
  12. ?> 

前台的配置文件:

  1. $config_arr1 = include_once WEB_ROOT . 'config.php'
  2. $config_arr2 = array
  3.    
  4. ); 
  5. return array_merge($config_arr1$config_arr2); 
  6. ?> 

后台的配置文件:

  1. $config_arr1 = include_once WEB_ROOT . 'config.php'
  2. $config_arr2 = array
  3.    
  4. ); 
  5. return array_merge($config_arr1$config_arr2); 
  6. ?> 

前台的入口文件:

  1. define("APP_NAME","index"); 
  2. define("APP_PATH","./index/"); 
  3. define('__PUBLIC__','__ROOT__/public/'); 
  4. define("WEB_ROOT", dirname(__FILE__) . "/"); 
  5. require("ThinkPHP/ThinkPHP.php"); 
  6. ?> 
分享到:
Thinkphp 关于URL路径 - Thinkphp
Thinkphp 关于URL路径 假如你项目首页的URL是:www.test.com/other/Form 假如当前模块是:Index 假如当前操作是:index 那么首页完整的URL:http://www.test.com/other/Form/index.php/Index/index __ROOT__:/other/thinkphp/mydemo __SELF__:/other/thinkphp/mydemo/Form/index.php ...
thinkphp 实现无限分类 - Thinkphp
thinkphp 实现无限分类 以上是效果图 1.数据库设计 2.添加后数据库的数据如下图 解析下:cid  栏目自增id pid 栏目的父类id,id为0表示是顶级栏目 cat_name  栏目名称 path 表示栏目的层级关系 实现效果主要用到: mysql的一个函数  concat():返回结果为连接参数产生的字符...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……