Home > Backend Development > PHP Tutorial > Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:51:07
Original
815 people have browsed it

Getting Started with Thinkphp 4 - Layout, Cache, System Variables (48), thinkphp48

[Controller Operation Method Parameter Settings]

http://website/index.php/controller/operation method

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial[Page jump]

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial【Variable Regulator】

Smarty variable regulator

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial[Subtemplate contains]

Current modules contain each other

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial【Use layout】

 1. Open the layout and configure variable information config.php

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial 2. Create layout file Tpl/home/layout.html

 3. Do not use layout {__NOLAYOUT__}

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP TutorialLayout Grouping

home admin
  a. Each group has its own configuration file config.php
b. Set the layout enable function for each layout file
c. Set the layout file for each group
Tp /home/layout.html
Tpl/admin/layout.html

Use custom layout

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial[tp framework cache usage]

Cache variable information (ordinary variables, arrays, objects),
Cache static html content, cache part or all

Most of our data is obtained from the mysql database.

Cache media: memory (memcache), file (processing database), cache to database

The data is stored in the database after optimization.

Tp framework’s file cache (shortcut function):
a) Set S (name, value)
b) Read S (name)
c) Delete S (name, null)

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial 1 You can set cache files to different directories to store

This can avoid storing too many cache files in one directory and affecting performance

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial 2 Cache validity period

S(name, value, time);

 3 Cache settings

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial 4 Cache usage:

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial 5 Cache deletion

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial 6 Caching use cases

Getting Started with Thinkphp 4—Layout, Cache, System Variables (48), thinkphp48_PHP Tutorial【System Variables】

Use all variables in the template $_GET $_POST $_SESSION $_COOKIE, etc.
Constant usage:
$Think.const.Constant name
$Think.get.Name

Get the configuration variable information config.php in the template
$Think.config.name

Get configuration variable information in the controller
C (name); //Shortcut function


[Output literal tags as they are]

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1014827.htmlTechArticleThinkphp Getting Started 4 - Layout, Cache, System Variables (48), thinkphp48 [Controller operation method parameter setting] http ://Website/index.php/Controller/Operation method [Page jump]...

Related labels:
source:php.cn
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
Latest Issues
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template