The following is an introduction to the ThinkPHP deployment directory from the thinkphp framework tutorial column. I hope it will be helpful to friends in need!
1. Problem: I was very confused about the directory structure when writing the project according to the deployment directory instructions in document 2.2.3
2. Solution: (Officially gives two deployment solutions)
1. Official recommendation Solution
Official recommended solution: (Table of contents as shown below)
#Operation Steps:
1.1 Download the ThinkPHP software package, create a new TESTAPP directory, and put the ThinkPHP folder into the TESTAPP folder.
1.2 If necessary Create the front-end directory Home and the back-end directory Admin, and create a new entry file index.php in the TESTAPP folder (used to create the Home directory). The code is as follows:
<?php //1.确定前台文件夹名称 Home define('APP_NAME','Home'); //2.确定应用路径 define('APP_PATH','./Home/'); //3.开启调试模式 define('APP_DEBUG',true); //4.应用核心文件 require './ThinkPHP/ThinkPHP.php';1.3 Create a new entry file admin.php in the TESTAPP folder (used to create the Admin directory). The code is as follows:
<?php //1.确定后台文件名称 Admin define('APP_NAME','Admin'); //2.确定应用路径 define('APP_PATH','./Admin/'); //3.开启调试模式,防止缓存造成调试问题 define('APP_DEBUG',true); //4.应用核心文件 require './ThinkPHP/ThinkPHP.php';1.4 After the two files are written, enter them in the browser. http://localhost/bbs/index.php automatically generates the Home folder, enter http://localhost/bbs/admin.php
When you see the Welcome to thinkPHP prompt, the directory structure is as shown in the figure:
Deployment Finish.
1.5 Start writing code
If you need a User controller, create a new UserAction.class in the Admin folder. php, write the following code:
##<?php
class UserAction extends Action {
public function index(){
$this->user=M('user')->select();
$this->display();
}
}
Create a new folder Home in tpl, create a new File index.html, write the following code:
##
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <!-- 引入 jquery 和 layer 插件 --> <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/layer/2.1/layer.js"></script> </head> <body> <a href="__URL__/add">添加</a> <table> <volist id="vo" name="user"> <tr> <td>{$vo.username}</td> <td><a href="{:U('Index/edit',array('id'=>$vo['id']))}">修 改</a></td> </tr> </volist> </table> </body> </html>Configure database information in config.php in Conf in the Admin folder Enter the URL http://localhost/TESTAPP/admin.php/User/index, you can see the results
2. Group module solution (will be added after testing)
The above is the detailed content of Learning: ThinkPHP deployment directory. For more information, please follow other related articles on the PHP Chinese website!

thinkphp是国产框架。ThinkPHP是一个快速、兼容而且简单的轻量级国产PHP开发框架,是为了简化企业级应用开发和敏捷WEB应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。

本篇文章给大家带来了关于thinkphp的相关知识,其中主要介绍了关于使用think-queue来实现普通队列和延迟队列的相关内容,think-queue是thinkphp官方提供的一个消息队列服务,下面一起来看一下,希望对大家有帮助。

thinkphp基于的mvc分别是指:1、m是model的缩写,表示模型,用于数据处理;2、v是view的缩写,表示视图,由View类和模板文件组成;3、c是controller的缩写,表示控制器,用于逻辑处理。mvc设计模式是一种编程思想,是一种将应用程序的逻辑层和表现层进行分离的方法。

本篇文章给大家带来了关于thinkphp的相关知识,其中主要介绍了使用jwt认证的问题,下面一起来看一下,希望对大家有帮助。

thinkphp扩展有:1、think-migration,是一种数据库迁移工具;2、think-orm,是一种ORM类库扩展;3、think-oracle,是一种Oracle驱动扩展;4、think-mongo,一种MongoDb扩展;5、think-soar,一种SQL语句优化扩展;6、porter,一种数据库管理工具;7、tp-jwt-auth,一个jwt身份验证扩展包。

thinkphp查询库是否存在的方法:1、打开相应的tp文件;2、通过“ $isTable=db()->query('SHOW TABLES LIKE '."'".$data['table_name']."'");if($isTable){...}else{...}”方式验证表是否存在即可。

本篇文章给大家带来了关于ThinkPHP的相关知识,其中主要整理了使用think-queue实现redis消息队列的相关问题,下面一起来看一下,希望对大家有帮助。

在thinkphp3.2中,可以利用define关闭调试模式,该标签用于变量和常量的定义,将入口文件中定义调试模式设为FALSE即可,语法为“define('APP_DEBUG', false);”;开启调试模式将参数值设置为true即可。


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

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

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