
How to write thinkphp admin
The writing method of thinkphp admin is "<?php namespace app\admin\controller;class Index{public function index(){return '...';}}"; there is an index.php file in the public directory of thinkphp5, copy And rename it to admin.php.
Dec 20, 2022 am 09:08 AM
What should I do if I get an error when deploying thinkphp5 in Pagoda?
Solution to the error reported when deploying thinkphp5 in Pagoda: 1. Open the Pagoda server, install the php pathinfo extension and enable it; 2. Configure the ".access" file with the content "RewriteRule ^(.*)$ index.php?s=/$1 [QSA ,PT,L]”; 3. In website management, just enable thinkphp’s pseudo-static.
Dec 19, 2022 am 11:04 AM
How to turn off the cache in thinkphp5.1
How to turn off the cache in thinkphp5.1: 1. Find the "\ThinkPHP\Common\convention.php" and "\ThinkPHP\Common\debug.php" files; 2. Modify the content in debug.php to "'TMPL_CACHE_ON' => false,"; 3. Modify the content in convention.php to "'ACTION_CACHE_ON' => false,".
Dec 13, 2022 am 09:58 AM
How to query duplicate database in thinkphp
How to query duplicate databases in thinkphp: 1. Instantiate the data table through "$test_data = M('hot');"; 2. Use "testdata>Distincttrue)->field(descriprion')->orderdescription desc->select" method or use the group method to remove duplicates.
Dec 13, 2022 am 09:51 AM
How to convert thinkphp collection to array
Method of converting thinkphp collection to array: 1. Get the data collection, the code is such as "Array([0] => app\common\model\GoodsSku Object([connection:protected] => Array()..."; 2. Use the "collection->toArray()" method to convert the data into a standard array type.
Dec 13, 2022 am 09:42 AM
How to use thinkphp addall method
The thinkphp addall method is a method provided by thinkphp for batch operations on data. This method is located in "Library/Think/Model.class.php". Its correct usage syntax is "$user->addAll($data, array(),true)".
Dec 13, 2022 am 09:30 AM
Can thinkphp configure a new database separately?
thinkphp can configure a new database separately. The setting method is: 1. Add configuration parameters such as "'DB_HOST' => 'localhost'..." in the application configuration file or module configuration file; 2. Configuration in different application states Independent database configuration information is defined in the file; 3. Specify the database connection information when instantiating, with syntax such as "$User = M('User','other_','mysql://root...".
Dec 13, 2022 am 09:24 AM
Does thinkphp5.1 support extra?
thinkphp5.1 does not support extra. The config function in thinkphp5.1 has canceled the support for extra; you can paste the "function editConfig($arr = [],$user='admin'){...}" code into the app or This function can be used globally in common.php in the application folder.
Dec 12, 2022 am 09:38 AM
How to jump to the current page in thinkphp
How thinkphp jumps to the current page: 1. Create a new login.html page under index/login; 2. Create a new login controller; 3. Determine whether the jump is successful through "protected function success(){...}" ; 4. Open the "dispatch_jump.tpl" file; 5. Modify the configuration code under "config.php".
Dec 12, 2022 am 09:21 AM
How to hide module name in thinkphp3.2
How to hide the module name in thinkphp3.2: 1. Create a ".htaccess" file in the root directory; 2. Add "RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d"; 3. Add "config.php" under the corresponding module "Set the access module in ".
Dec 09, 2022 am 10:11 AM
THINKPHP public What to do if something goes wrong
Solution to THINKPHP public error: 1. Find and open the ".htaccess" file in the public directory; 2. Directly replace the content with "RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f". .
Dec 09, 2022 am 09:28 AM
What should I do if the thinkphp5 display class does not exist?
Solution to the non-existence of thinkphp5 display class: 1. Query through the new Employee class in the Controller layer; 2. Modify the code to "$dlist = Db::name("employee")->where($condition)->field ("id,name")->select();" can be done.
Dec 09, 2022 am 09:22 AM
How to query if there is data in thinkphp
How to query whether there is data in thinkphp: 1. Open the corresponding tp file; 2. Instantiate the object through "M("gkwh_dictdata");"; 3. Use "if($list_dictdata !== null) {$obj-> code = -1;...}" statement can be used to determine whether the data exists.
Dec 09, 2022 am 09:17 AM
What to do if thinkphp tcpdf is garbled?
Solution to thinkphp tcpdf garbled code: 1. Download the plug-in TCPDF; 2. Use TCPDF through "class Pdf extends \app\common\controller\Base{...}"; 3. Change the font to "$pdf->SetFont ('cid0cs', '', 8)" can solve the garbled code problem.
Dec 08, 2022 am 10:29 AM
Hot tools Tags

Undress AI Tool
Undress images for free

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

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

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

vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version
Chinese version, very easy to use
