thinkphp procedures for applying a tag library

Source: Internet
Author: User
thinkphp steps to use the tag library

Application Examples: In the business center management of supply and demand Information page: using the tag library to generate a list;

Step One:
under the project configuration file conf folder, create a new taglibs.php file that will
return Array (
' html ' = ' @ '. Taglib.taglibhtml ',//path format supported using the Import method
);
copy it, which is the definition of which tag library to use in this project;

Step Two:
in the Lib directory, create a new TagLib folder;
lib/taglib/tags/html.xml???????? The definition file of the tag library;
lib/taglib/taglibhtml.class.php. The parsing class of tag library;

Step Three:
copy CommonAction.class.php? Under the action directory;
copy CommonModel.class.php? Under the model directory;

Step Four:
lib/action directory; Create a new class: For example: ProductsAction.class.php

class Productsaction extends Commonaction {
}
if written as:
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;

this place needs to be noted: products must be the table name of the corresponding database;


Step Five:
Create a new products folder in the template;
index.html? need to contain;

the basic JS file;








load Tag Library:




?


{$page}

  • 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.