国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
ThinkPHP項目分組配置方法分析,thinkphp項目
您可能感興趣的文章:
Home php教程 php手冊 ThinkPHP項目分組配置方法分析,thinkphp項目

ThinkPHP項目分組配置方法分析,thinkphp項目

Jun 13, 2016 am 08:43 AM
thinkphp Configuration

ThinkPHP項目分組配置方法分析,thinkphp項目

本文實例講述了ThinkPHP項目分組配置方法。分享給大家供大家參考,具體如下:

項目分組概述

項目分組是 ThinkPHP 一個重要機制,項目分組功能可以把以往的多項目合并到一個項目中去,對于公共的文件可以重用,但每個分組又可以有自己獨立的配置文件、公共文件、語言包等。

以一個普通的網(wǎng)站為例,如果不采用項目分組,那么通常是將網(wǎng)站前臺(提供給用戶瀏覽部分)作為一個項目。而網(wǎng)站的后臺管理部分,可能有獨立的配置文件,CSS文件及模板等,因此作為另一個項目來管理。但實際上這兩個項目都是網(wǎng)站的內(nèi)容,他們之間可以共享一些內(nèi)容如數(shù)據(jù)庫配置文件甚至一些模型類和跨項目操作等。

項目分組就很好的解決了同一個系統(tǒng)下各項目之間的共性與個性問題。

項目分組配置

在系統(tǒng)配置文件(Config/config.php)里面進行簡單的項目分組配置即可開啟項目分組。

與項目分組模式有關(guān)的配置有五個:

配置選項 說明 例子或建議
APP_GROUP_LIST 項目分組所有名稱列表,若不設(shè)置則表示不啟用項目分組模式 'APP_GROUP_LIST'=>'Home,Admin,User,Blog',
DEFAULT_GROUP 默認的項目分組名稱,系統(tǒng)默認是 Home 'DEFAULT_GROUP' =>'Home',
APP_GROUP_DEPR 項目分組之間的分割符,默認是 . (點),用于 A函數(shù) D函數(shù) 和 路由配置中的分隔 建議默認
TMPL_FILE_DEPR 模板文件中模塊與操作之間的分割符,默認是 / ,只對項目分組部署有效 建議默認,可使用 U 方法自動生成 URL
VAR_GROUP 獲取項目分組名稱的變量,默認是 g index.php?g=Admin&m=Index&a=edit,建議默認

當 TMPL_FILE_DEPR 配置為 _ 時,以 Admin 分組 Index 模塊 add 操作來說,其對應的模板文件由原來的:

Tpl/default/Admin/Index/add.html

變更為:

Tpl/default/Admin/Index_add.html

通過這個配置,使模板目錄結(jié)構(gòu)減少了一層目錄。

提示:TMPL_FILE_DEPR 同時也是語言文件中分組語言定義與語言文件之間的分隔符。

以上配置選項中,要啟用分組,APP_GROUP_LIST 必須設(shè)置,其他選項則根據(jù)實際情況加以配置。

項目分組個性配置

如果要為分組的項目添加獨自的個性化配置,可以在配置目錄 Conf 下,建立與項目組名稱相同的目錄(目錄命名格式是:分組名稱的首字母大寫+其余字母小寫的形式),并在目錄內(nèi)定義一個 config.php 配置文件。如 Admin 項目的個性配置文件:

Conf/Admin/config.php

當分組名稱的目錄下有定義 config.php 文件時,每次訪問該分組,系統(tǒng)會自動加載分組的獨立配置并覆蓋公共配置中相同選項的設(shè)定。

更多關(guān)于thinkPHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《ThinkPHP入門教程》、《ThinkPHP常用方法總結(jié)》、《smarty模板入門基礎(chǔ)教程》及《PHP模板技術(shù)總結(jié)》。

希望本文所述對大家基于ThinkPHP框架的PHP程序設(shè)計有所幫助。

您可能感興趣的文章:

  • Nginx配置支持ThinkPHP的PATH_INFO
  • Nginx下支持Thinkphp URL Rewrite的配置示例
  • THINKPHP支持YAML配置文件的設(shè)置方法
  • thinkPHP學習筆記之安裝配置篇
  • thinkphp配置連接數(shù)據(jù)庫技巧
  • thinkphp的URL路由規(guī)則與配置實例
  • ThinkPHP公共配置文件與各自項目中配置文件組合的方法
  • ThinkPHP中公共函數(shù)路徑和配置項路徑的映射分析
  • ThinkPHP慣例配置文件詳解
  • 在nginx中配置pathinfo模式支持thinkphp的URL重寫
  • 修改apache配置文件去除thinkphp url中的index.php
  • 解析thinkphp基本配置 convention.php
  • ThinkPHP的常用配置選項匯總
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The working principle and configuration method of GDM in Linux system The working principle and configuration method of GDM in Linux system Mar 01, 2024 pm 06:36 PM

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

How to run thinkphp project How to run thinkphp project Apr 09, 2024 pm 05:33 PM

To run the ThinkPHP project, you need to: install Composer; use Composer to create the project; enter the project directory and execute php bin/console serve; visit http://localhost:8000 to view the welcome page.

There are several versions of thinkphp There are several versions of thinkphp Apr 09, 2024 pm 06:09 PM

ThinkPHP has multiple versions designed for different PHP versions. Major versions include 3.2, 5.0, 5.1, and 6.0, while minor versions are used to fix bugs and provide new features. The latest stable version is ThinkPHP 6.0.16. When choosing a version, consider the PHP version, feature requirements, and community support. It is recommended to use the latest stable version for best performance and support.

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

Which one is better, laravel or thinkphp? Which one is better, laravel or thinkphp? Apr 09, 2024 pm 03:18 PM

Performance comparison of Laravel and ThinkPHP frameworks: ThinkPHP generally performs better than Laravel, focusing on optimization and caching. Laravel performs well, but for complex applications, ThinkPHP may be a better fit.

How to install thinkphp How to install thinkphp Apr 09, 2024 pm 05:42 PM

ThinkPHP installation steps: Prepare PHP, Composer, and MySQL environments. Create projects using Composer. Install the ThinkPHP framework and dependencies. Configure database connection. Generate application code. Launch the application and visit http://localhost:8000.

How is the performance of thinkphp? How is the performance of thinkphp? Apr 09, 2024 pm 05:24 PM

ThinkPHP is a high-performance PHP framework with advantages such as caching mechanism, code optimization, parallel processing and database optimization. Official performance tests show that it can handle more than 10,000 requests per second and is widely used in large-scale websites and enterprise systems such as JD.com and Ctrip in actual applications.

See all articles