thinkphp 的 Action 控制器中的系统常量总结
刚刚入手学习 thinkphp 框架,下面将 thinkphp 的 Action 控制器中可以直接使用的系统常量做一下总结,方便记忆以后直接使用。
THINK_PATH // ThinkPHP 系统目录
APP_PATH // 当前项目目录
APP_NAME // 当前项目名称
MODULE_NAME //当前模块名称
ACTION_NAME // 当前操作名称
TMPL_PATH // 项目模版目录
LIB_PATH // 项目类库目录
CACHE_PATH // 项目模版缓存目录
CONFIG_PATH //项目配置文件目录
LOG_PATH // 项目日志文件目录
LANG_PATH // 项目语言文件目录
TEMP_PATH //项目临时文件目录
PLUGIN_PATH // 项目插件文件目录
VENDOR_PATH // 第三方类库目录
DATA_PATH // 项目数据文件目录
IS_APACHE // 是否属于 Apache
IS_IIS //是否属于 IIS
IS_WIN //是否属于Windows 环境
IS_LINUX //是否属于 Linux 环境
IS_FREEBSD //是否属于 FreeBsd 环境
NOW_TIME // 当前时间戳
MEMORY_LIMIT_ON // 是否有内存使用限制
OUTPUT_GZIP_ON // 是否开启输出压缩
MAGIC_QUOTES_GPC // MAGIC_QUOTES_GPC
THINK_VERSION //ThinkPHP 版本号
LANG_SET // 浏览器语言
TEMPLATE_NAME //当前模版名称
TEMPLATE_PATH //当前模版路径
__ROOT__ // 网站根目录地址
__APP__ // 当前项目(入口文件)地址
__URL__ // 当前模块地址
__ACTION__ // 当前操作地址
__SELF__ // 当前 URL 地址
__PUBLIC__ // 网站公共目录
TMPL_FILE_NAME //当前操作的默认模版名(含路径)
WEB_PUBLIC_URL //网站公共目录
APP_PUBLIC_URL //项目公共模版目录模板中使用的系统常量
您可能感兴趣的文章
- Thinkphp 模板中常用的系统变量总结
- PHP 利用 Curl Functions 实现多线程抓取网页和下载文件
- thinkphp 如何去除url中的index.php
- thinkphp打印最后一条sql语句
- thinkphp模板中判断volist循环的最后一条记录
- ThinkPHP中的查询技巧总结
- PHP中的字符串处理函数(String Functions) 全总结
- php 将字符串中的连续多个空格转换为一个空格

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



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.

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.

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.

DJI has not confirmed any plans to introduce a new action camera yet. Instead, it seems that GoPro will get ahead of its rival this year, having teased that it will introduce two new action cameras on September 4. For context, these are expected to a

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.

"Development Suggestions: How to Use the ThinkPHP Framework to Implement Asynchronous Tasks" With the rapid development of Internet technology, Web applications have increasingly higher requirements for handling a large number of concurrent requests and complex business logic. In order to improve system performance and user experience, developers often consider using asynchronous tasks to perform some time-consuming operations, such as sending emails, processing file uploads, generating reports, etc. In the field of PHP, the ThinkPHP framework, as a popular development framework, provides some convenient ways to implement asynchronous tasks.

Learning Laravel from scratch: Detailed explanation of controller method invocation In the development of Laravel, controller is a very important concept. The controller serves as a bridge between the model and the view, responsible for processing requests from routes and returning corresponding data to the view for display. Methods in controllers can be called by routes. This article will introduce in detail how to write and call methods in controllers, and will provide specific code examples. First, we need to create a controller. You can use the Artisan command line tool to create

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.
