Thinkphp Getting started four-layouts, caches, System variables (thinkphp48_php), tutorial

Source: Internet
Author: User

Thinkphp Getting started four-layouts, caches, System variables (THINKPHP48)


"Controller action method parameter settings"

http://URL/index.php/Controller/operation method

"Page Jump"

"Variable Adjuster"

Smarty Variable Adjuster

"Child template contains"

Current modules contain each other

"Using layout layouts"

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

2. make layout file tpl/home/layout.html

3. Do not use layout {__nolayout__}

Layout grouping

Home Admin
A, each group has its own configuration file config.php
B. Set the layout opening function for each layout file
C, set the layout file for each group
Tp/home/layout.html
Tpl/admin/layout.html

Using the custom layout

"TP Framework Cache use"

Cache variable information (normal variable, array, object),
Caching static HTML content, caching part or all

The most of our data is obtained from the MySQL database.

Cache Media: Memory (memcache), file (resolve database), cache to database

The data is optimized and stored inside the database.

File cache for TP framework (shortcut function):
A) Set S (name, value)
b) Read S (name)
c) Remove S (name, NULL)

1 You can set the cache file to a different directory to store

This prevents a directory from storing too many cache files, which can affect performance

2 Cache Expiration

S (name, value, time);

3 Cache Settings

4 Cache Usage:

5 Cache deletion

6 Caching Use Cases

"System Variables"

Use all variables inside the template $_get $_post $_session $_cookie, etc.
Constants use:
$Think. Const. Constant name
$Think. Get. Name

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

Get configuration variable information inside the controller
C (name); Shortcut functions


"Output literal label as-is"

http://www.bkjia.com/PHPjc/1014827.html www.bkjia.com true http://www.bkjia.com/PHPjc/1014827.html techarticle thinkphp Getting Started four-layout, cache, System variable (THINKPHP48), "Controller action method parameter settings" http://URL/index.php/controller/How to "page Jump" ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.