How does thinkphp use the tag library? Application example: in the business center? Manage supply and demand information page: use the tag library to generate a list. Step 1: Create a taglibs in the Conf folder of the project configuration file. php file, convert returnarray (html & gt ;@. tagLib. tagLibHtml, using the path format supported by the import method); copy it in. this is the step to define the use of the tag library for this thinkphp project.
? Application example: in the business center? Manage supply and demand information page: generate a list using the tag library;
Step 1:
In the Conf folder of the project configuration file, create a new taglibs. php file
Return array (
'Html' => '@. TagLib. TagLibHtml', // use the path format supported by the import method
);
Copy it in, which defines the tag library used in this project;
Step 2:
Create a new TagLib folder under the Lib directory;
Lib/TagLib/Tags/html. xml ???????? Tag library definition file;
Lib/TagLib/TagLibHtml. class. php? The parsing class of the tag library;
Step 3:
Copy CommonAction. class. php? Under the Action directory;
Copy CommonModel. class. php? Under the Model directory;
Step 4:
In the lib/Action Directory, create a class, for example, ProductsAction. class. php.
Class ProductsAction extends CommonAction {
}
If it is written:
Class FormAction extends CommonAction {
// Filter query fields
Function _ filter (& $ map ){
$ Map ['title'] = array ('like', "%". $ _ POST ['name']. "% ");
}
}
_ The filter function is used to pass query conditions;
Note that Products must be the table name of the corresponding database;
Step 5:
Create a new Products folder in the template;
Index.html? Need to include;
Basic JS files;