Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of flexible Application of View Class in DEDECMS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the method of flexible application of view class in DEDECMS. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

How does DEDECMS flexibly apply view classes?

Having a preliminary understanding of Weaving Dream cms, I can't help but have a try. Dream weaving cms also uses the mvc design pattern, and most of its core code exists in the include directory. It includes controller, model, view class, template engine, tag library, common function and so on.

Recommended study: dream weaving cms

Let's simply create a php page processing file of our own, in which I parse the static html file I created in advance with the template engine and view of Weaving Dream itself. Here, I simply write the following code:

The first step is to create your own php page processing file. Here, I create the demo.php file in the root directory, with the following contents:

The code is as follows:

Second, create a template page.

Lazy people save trouble. Similarly, I created the demo.html file in the root directory, which is as follows:

The code is as follows:

Demo Test View body {font-size:12px;} ul li {float:left; list-style:none;padding:2px 10px;} ul li a {} # arclist li {clear:both;float:none;} {dede:channel type='top' row='10' currentstyle= "~ typename~"} [field:typename/] {/ dede:channel} {dede:arclist row= "10"} [field:title/] {/ dede:arclist}

In the demo.html file, I test the program with the tags {dede:channel} and {dede:arclist}, and the results are as follows:

In this way, all the transferred information is presented.

On the flexible application of DEDECMS view class method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report