current location:Home > Technical Articles > PHP Framework > ThinkPHP

  • How to turn off the cache in thinkphp5.1
    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,".
    ThinkPHP 1464 2022-12-13 09:58:56
  • How to query duplicate database in thinkphp
    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.
    ThinkPHP 1619 2022-12-13 09:51:01
  • How to convert thinkphp collection to array
    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.
    ThinkPHP 1984 2022-12-13 09:42:43
  • How to use thinkphp addall method
    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)".
    ThinkPHP 1848 2022-12-13 09:30:34
  • Can thinkphp configure a new database separately?
    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...".
    ThinkPHP 1662 2022-12-13 09:24:40
  • Does thinkphp5.1 support extra?
    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.
    ThinkPHP 1861 2022-12-12 09:38:30
  • How to jump to the current page in thinkphp
    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".
    ThinkPHP 2163 2022-12-12 09:21:28
  • How to hide module name in thinkphp3.2
    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 ".
    ThinkPHP 1801 2022-12-09 10:11:01
  • THINKPHP public What to do if something goes wrong
    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". .
    ThinkPHP 1227 2022-12-09 09:28:31
  • What should I do if the thinkphp5 display class does not exist?
    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.
    ThinkPHP 1781 2022-12-09 09:22:15
  • How to query if there is data in thinkphp
    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.
    ThinkPHP 1435 2022-12-09 09:17:22
  • What to do if thinkphp tcpdf is garbled?
    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.
    ThinkPHP 1593 2022-12-08 10:29:56
  • How to use thinkphp5 model method
    How to use thinkphp5 model method
    How to use thinkphp5 model: 1. Query multiple records through "User::all(function($query){...}"; 2. Use "User::select(function($query){...}" "Query; 3. Query through find() method and get() method; 4. Query data using column() method.
    ThinkPHP 1917 2022-12-08 10:20:28
  • What to do if thinkphp resource routing error occurs
    What to do if thinkphp resource routing error occurs
    Solutions to thinkphp resource routing errors: 1. Open the corresponding tp file; 2. Set the resource routing for RESTFul requests through "Route::resource('blog','index/blog');"; 3. Replace public Orientation is enough.
    ThinkPHP 1254 2022-12-08 10:08:43
  • How to close cache in thinkphp
    How to close cache in thinkphp
    How to close the cache in thinkphp: 1. Find the convention.php and debug.php files; 2. Modify the content in debug.php to "'TMPL_CACHE_ON' =>false,"; 3. Modify the content in convention.php to "' HTML_CACHE_ON' => false," that's it.
    ThinkPHP 1855 2022-12-08 09:58:13

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!