Home>Article>Backend Development> How to use thinkPHP's Html template tags
This article mainly introduces how to use Html template tags in thinkPHP. It has a certain reference value. Now I share it with you. Friends in need can refer to it
If we need a select drop-down menu now item, then we can do this in ThinkPHP
Note: Before using tags such as c7040750bcf6a21804e263a965d67cfb, you must introduce the TP tag library: 24fe360d7691f7a0a3f90108ae1bba3b
If we need a select drop-down menu item now, we can do this in ThinkPHP.
1. Obtain data in the method of the Action controller, for example:
##Copy codeThe code is as follows:
public function mylist(){ $user = new Model(‘User'); $list = $user->getField(‘id,username'); $this->assign(‘users',$list); $this->display(); }
2. Import the tag library into the template page and write the following code
The code is as follows:
In this way, we only use a simple tag to achieve the following functions: (Compiled HTML code)
##Copy code
ThinkPHP template judgment output Empty tag usage
Use thinkphp’s own method to generate static html files
The above is the detailed content of How to use thinkPHP's Html template tags. For more information, please follow other related articles on the PHP Chinese website!