Home PHP Framework ThinkPHP How to apply themes in thinkphp5

How to apply themes in thinkphp5

Aug 23, 2019 am 11:25 AM
thinkphp5 theme

How to apply themes in thinkphp5

How to apply themes in thinkphp5:

Configuration items:

'DEFAULT_THEME'=>'default',//默认主题    
'THEME_LIST'=>'default,theme',//主题列表    
'TMPL_DETECT_THEME'=>true//开启自动侦测模版主题
Copy after login

Related recommendations: "ThinkPHP Tutorial

Write like this in the action:

$this->theme('theme');//要调用的模版主题名字$this->display('index:index');
Copy after login

Of course, you can also make a function to let users choose the theme themselves, which is achieved by modifying the default theme of the configuration item; it can also be changed dynamically through the t parameter Theme, url?t=theme, and will be automatically saved to cookies.
The usage of the display method for calling templates across independent groups is:

$this->display('admin@index:index);
Copy after login

admin is the group name, index:index are the module name and operation name respectively.

The above is the detailed content of How to apply themes in thinkphp5. For more information, please follow other related articles on the PHP Chinese website!

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

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.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Where are themes located in Windows 11? Where are themes located in Windows 11? Aug 01, 2023 am 09:29 AM

Windows 11 has so many customization options, including a range of themes and wallpapers. While these themes are aesthetic in their own way, some users still wonder where they stand in the background on Windows 11. This guide will show you the different ways to access the location of your Windows 11 theme. What is the Windows 11 default theme? The default theme background of Windows 11 is an abstract royal blue flower blooming with a sky blue background. This background is one of the most popular, thanks to the anticipation before the release of the operating system. However, the operating system also comes with a range of other backgrounds. Therefore, you can change the Windows 11 desktop theme background at any time. Themes are stored in Windo

How to detail the location of the win10 theme folder How to detail the location of the win10 theme folder Dec 27, 2023 pm 09:37 PM

Recently, many friends feel that the theme of Win10 does not meet their own aesthetics and want to change the theme. After downloading it online, they find that the folder cannot be found. Then the editor will show you how to find the folder of the Win10 theme. Which folder is the win10 theme in? 1. The default storage path location of Win10 system wallpapers: 1. Microsoft saves these pictures in the path C:\Windows\Web\Wallpaper. Under it are the default saves of pictures with three different themes. Location, 2, flowers and lines and colors theme pictures are also saved in the folder with the same name! The naming principle is imgXXX. We only need to follow this principle to change the name of the related image we want to set and paste the image into

How to unapply a theme (change or remove) in Windows 11 How to unapply a theme (change or remove) in Windows 11 Sep 30, 2023 pm 03:53 PM

Themes play an integral role for users who wish to modify their Windows experience. It may change the desktop background, animations, lock screen, mouse cursor, sounds, icons, etc. But what if you want to remove themes in Windows 11? It's equally simple and there are options available, both for the current user profile and for the entire system, i.e. all users. Additionally, you can even delete custom themes in Windows 11 if they are no longer used for that purpose. How do I find my current topic? Press + to open the Settings app > Go to Personalization from the navigation pane > Click on Themes > The current theme will be listed on the right. How about WindowsI

win10 theme background picture location win10 theme background picture location Jan 05, 2024 pm 11:32 PM

Some friends want to find the theme pictures of their own system, but don’t know where the win10 theme pictures are stored. In fact, we only need to enter the Windows folder on the C drive to find the location of the theme pictures. The storage location of win10 theme images A: The win10 theme images are stored in the "themes" folder of the C drive. 1. First, we enter "This PC" 2. Then open the "c drive" (system drive) 3. Then enter the "Windows" folder in it. 4. Find and open the "resources" folder. 5. After entering, open the “themes” folder. 6. You can see the win10 theme pictures in the folder. Windows theme pictures are in a special format,

What should I do if I get an error when deploying thinkphp5 in Pagoda? What should I do if I get an error when deploying thinkphp5 in Pagoda? Dec 19, 2022 am 11:04 AM

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.

How to adjust a WordPress theme to avoid misaligned display How to adjust a WordPress theme to avoid misaligned display Mar 05, 2024 pm 02:03 PM

How to adjust WordPress themes to avoid misaligned display requires specific code examples. As a powerful CMS system, WordPress is loved by many website developers and webmasters. However, when using WordPress to create a website, you often encounter the problem of theme misalignment, which affects the user experience and page beauty. Therefore, it is very important to properly adjust your WordPress theme to avoid misaligned display. This article will introduce how to adjust the theme through specific code examples.

How to adjust WeChat back to black theme How to adjust WeChat back to black theme Feb 05, 2024 pm 02:12 PM

In the WeChat software, we can use the black theme mode or the default theme mode. So some users’ WeChat has turned into a black theme. How do they want to switch it back? Now let’s take a look at how to switch WeChat back to a black theme. 1. First open WeChat and enter the homepage, then click [My] in the lower right corner; 2. Then click [Settings] on the My page; 3. Then go to the settings page and click [General]; 4. Enter the general Click [Dark Mode] on the page; 5. Finally, click [Normal Mode] on the dark mode page;

What should I do if thinkphp5 url rewriting fails? What should I do if thinkphp5 url rewriting fails? Dec 12, 2022 am 09:31 AM

Solution to thinkphp5 url rewriting not working: 1. Check whether the mod_rewrite.so module is loaded in the httpd.conf configuration file; 2. Change None in AllowOverride None to All; 3. Modify the Apache configuration file .htaccess to "RewriteRule ^ (.*)$ index.php [L,E=PATH_INFO:$1]" and save it.

See all articles