First, the background management template
Background management templates are usually laid out using Frameset/iframe. For example:
<!DOCTYPE HTML><HTML><Head> <title>Frameset</title></Head><Body> <Frameset> <Framesrc= "left.html"></Frame> <Frameset> <Framesrc= "left.html"></Frame> <Framesrc= "right.html"></Frame> </Frameset>></Frameset></Body></HTML>
But in using framework development we don't go directly to a page, but instead access a controller to get a rendered template. A controller is implemented for the product type structure above.
Second, the controller
<?php namespace Home\controller; Usemysqli; UseThink\controller; /** * */ classIndexcontollerextendscontroller{ //Render main view Public functionindex () {$this-display (); } //Render top view Public functionTop () {$this-display (); } //Render left view Public functionLeft () {$this-display (); } //Render right view Public functionRight () {$this-display (); } }Three, the template
<!DOCTYPE HTML><HTML><Head> <title>Frameset</title></Head><Body> <Frameset> <Framesrc= "Localhost/applaction/home/idex/top"></Frame> <Frameset> <Framesrc= "Localhost/applaction/home/idex/left"></Frame> <Framesrc= "Localhost/applaction/home/idex/right"></Frame> </Frameset>></Frameset></Body></HTML>
Here the SRC is all replaced with the corresponding controller
<!DOCTYPE HTML><HTML><Head> <title>Frameset</title></Head><Body> This is the right of the</Body></HTML>
Iv. Use of constants
A number of constants have been defined in thinkphp and we can use them directly.
To view the system-defined constants, Get_defined_constants is the function used to get all the constants.
Public function Getserverconst () { var_dump(get_defined_constants(true)); }
Frequent use of path-related constants has the following
This is the structure of my project:
Using constants directly in HTML
Access results
Using the tinkphp to achieve a product-style layout