Table of Contents
ThinkPHP realizes the method of permanently modifying the front-end view page in the visual background management
Home Backend Development PHP Tutorial ThinkPHP realizes the method of permanently modifying the front-end view page in the visual background management_PHP tutorial

ThinkPHP realizes the method of permanently modifying the front-end view page in the visual background management_PHP tutorial

Jul 13, 2016 am 09:54 AM
front end permanent view

ThinkPHP realizes the method of permanently modifying the front-end view page in the visual background management

I have been wondering about the issue, that is, like csdn, users can modify their own homepage style, and the modification is permanent. Many places have invited people to hand over the view style to the user. This is also the future. The development trend, like QQ space decoration, and even the backend of some website building programs are like this, so it is very important to understand this principle.

First of all, this is obviously impossible to achieve through the front end, because the things in the front end are ultimately placed in the memory when they reach the user. The memory is volatile, so it should be placed in the background. Similarly, we cannot To directly modify the background files, which is very costly, then we need to put them into the database. The data in the database is stored in the hard disk and is not easy to lose. Moreover, it is also easy to operate through the background files. In this case, the idea is .

In the background visual management interface, various styles of buttons, forms, etc. are stored, including specifically modified pages. In the database, the style data of the foreground view is stored. There is a missing connection in the middle, but smarty is perfect. It solves this problem and separates the data. Modification means modifying the database data, and extraction means extracting the database style. This is the core principle.

Here is a sample code of mine for reference only:

<!--?php
namespace Home\Controller;
use Think\Controller;
class TestController extends Controller {
   	public function test1(){
   		$info=D("style");

   		$temp=$info--->select();
   		$info->id=&#39;2&#39;;
   		$info->value=$_POST[value];
   		$info->save();
   		$bg=$temp[1][&#39;value&#39;];
   		$size=$temp[4][&#39;value&#39;];
   		echo $bg;
   		echo "
";
   		echo $size;
   		$this->assign(bg,$bg);
   		$this->assign(size,$size);
   		$this->display();
   	}

}
Copy after login

Copy after login
Test Match

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/997427.htmlTechArticleThinkPHP implements a method to permanently modify the front-end view page in the visual background management. I have been wondering about things like Like csdn, users can modify their own homepage...
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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
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)

How to implement editable tables in Vue How to implement editable tables in Vue Nov 08, 2023 pm 12:51 PM

Tables are an essential component in many web applications. Tables usually have large amounts of data, so tables require some specific features to improve user experience. One of the important features is editability. In this article, we will explore how to implement editable tables using Vue.js and provide specific code examples. Step 1: Prepare the data First, we need to prepare the data for the table. We can use a JSON object to store the table's data and store it in the data property of the Vue instance. In this case

PHP and Vue: a perfect pairing of front-end development tools PHP and Vue: a perfect pairing of front-end development tools Mar 16, 2024 pm 12:09 PM

PHP and Vue: a perfect pairing of front-end development tools. In today's era of rapid development of the Internet, front-end development has become increasingly important. As users have higher and higher requirements for the experience of websites and applications, front-end developers need to use more efficient and flexible tools to create responsive and interactive interfaces. As two important technologies in the field of front-end development, PHP and Vue.js can be regarded as perfect tools when paired together. This article will explore the combination of PHP and Vue, as well as detailed code examples to help readers better understand and apply these two

Understand the differences and comparisons between SpringBoot and SpringMVC Understand the differences and comparisons between SpringBoot and SpringMVC Dec 29, 2023 am 09:20 AM

Compare SpringBoot and SpringMVC and understand their differences. With the continuous development of Java development, the Spring framework has become the first choice for many developers and enterprises. In the Spring ecosystem, SpringBoot and SpringMVC are two very important components. Although they are both based on the Spring framework, there are some differences in functions and usage. This article will focus on comparing SpringBoot and Spring

Questions frequently asked by front-end interviewers Questions frequently asked by front-end interviewers Mar 19, 2024 pm 02:24 PM

In front-end development interviews, common questions cover a wide range of topics, including HTML/CSS basics, JavaScript basics, frameworks and libraries, project experience, algorithms and data structures, performance optimization, cross-domain requests, front-end engineering, design patterns, and new technologies and trends. . Interviewer questions are designed to assess the candidate's technical skills, project experience, and understanding of industry trends. Therefore, candidates should be fully prepared in these areas to demonstrate their abilities and expertise.

What are the views in Word? What are the views in Word? Mar 19, 2024 pm 06:10 PM

I guess that many students want to learn the typesetting skills of Word, but the editor secretly tells you that before learning the typesetting skills, you need to understand the word views clearly. In Word2007, 5 views are provided for users to choose. These 5 views include pages. View, reading layout view, web layout view, outline view and normal view, let’s learn about these 5 word views with the editor today. 1. Page view Page view can display the appearance of the print result of the Word2007 document, which mainly includes headers, footers, graphic objects, column settings, page margins and other elements. It is the page view closest to the print result. 2. Reading layout view Reading layout view displays Word2007 documents and Office in the column style of a book

Is Django front-end or back-end? check it out! Is Django front-end or back-end? check it out! Jan 19, 2024 am 08:37 AM

Django is a web application framework written in Python that emphasizes rapid development and clean methods. Although Django is a web framework, to answer the question whether Django is a front-end or a back-end, you need to have a deep understanding of the concepts of front-end and back-end. The front end refers to the interface that users directly interact with, and the back end refers to server-side programs. They interact with data through the HTTP protocol. When the front-end and back-end are separated, the front-end and back-end programs can be developed independently to implement business logic and interactive effects respectively, and data exchange.

C# development experience sharing: front-end and back-end collaborative development skills C# development experience sharing: front-end and back-end collaborative development skills Nov 23, 2023 am 10:13 AM

As a C# developer, our development work usually includes front-end and back-end development. As technology develops and the complexity of projects increases, the collaborative development of front-end and back-end has become more and more important and complex. This article will share some front-end and back-end collaborative development techniques to help C# developers complete development work more efficiently. After determining the interface specifications, collaborative development of the front-end and back-end is inseparable from the interaction of API interfaces. To ensure the smooth progress of front-end and back-end collaborative development, the most important thing is to define good interface specifications. Interface specification involves the name of the interface

What is a front-end modular ESM? What is a front-end modular ESM? Feb 25, 2024 am 11:48 AM

What is front-end ESM? Specific code examples are required. In front-end development, ESM refers to ECMAScriptModules, a modular development method based on the ECMAScript specification. ESM brings many benefits, such as better code organization, isolation between modules, and reusability. This article will introduce the basic concepts and usage of ESM and provide some specific code examples. The basic concept of ESM In ESM, we can divide the code into multiple modules, and each module exposes some interfaces for other modules to

See all articles