Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use TP5 taglib Custom tags

Shulou Source: shulou.com Published: 2022-06-03 15:50:24 11月14日 Update

This article shows you how to use TP5 taglib custom tags, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

Taglib is a custom tag feature of the tp framework. If you have used cms, you must have seen something like this:

{dede:arclist typeid='' row='' col='' titlelen='' infolen='' orderby='' keyword=''} ssss... {/ dede:arclist}

Or:

{pc:content action= "lists" cache= "3600" num= "20" page= "$page"} {/ pc}

This kind of operation is very convenient for development work, so I think it is necessary to take a look at tp's taglib. The tutorial is as follows:

1. Create a new directory taglib in common (I am in common, you see for yourself, but it is loaded with namespace anyway)

2. Create a new Tglib that inherits think from Cc.php in taglib, as follows:

Tags: Tags templates tags that is engines files articles general code content skills knowledge support configuration simplicity necessity conciseness delimiters functions suffixes Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Apple Shulou Information NVidia Xiaomi