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 customizing form in phpcms

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

Share

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

How to customize the form in phpcms? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

How phpcms customizes forms

The steps to customize the form are as follows:

(1): open the background, click the module, find the form wizard, click the add form wizard, and the interface below appears.

(2): next, we need to introduce the two options of template selection in the above figure and template used by js call. For template selection, it is actually the foreground page of our form. The template used by js call represents the jump operation performed after the form is submitted. In general, we only need to switch part of the template selection to realize the form style modification. There is no need for us to do anything about the template used in the js call. Where is the specific template selection show.html and the template used in the js call stored in show_js.html?

The answer is under the phpcms\ templates\ default\ formguide path, so in practice, we just need to switch the template selection, where I define a show_message.html file and switch the template selection location to my show_message.html file.

Related recommendation: phpcms tutorial

(3): next is my show_message.html document writing process, the preparation of this document needs to refer to the original show.html writing, let's take a look at the show.html part about the form is written.

Normally you can copy it directly to the action section of your form form.

(2): as for the name= "myform" id= "myform" part under the form tag, it is optional. You can write it or not if you want to write it.

(3): next is the {loop $forminfos_data $field $info} loop body, which is more important. $field gets the English name of the field you take when you add the field after creating the form wizard, which corresponds to the field in the database that stores your message information. While $info stores some additional information about how you define the Datasheet field, such as the Chinese name of the Datasheet field, where are these values set? This is what you fill in in the interface that appears after you click on the add field after you have created the form, specifically the following interface:

(4): next is the variable traversal loop, whose main function is to loop the form information content created for us according to the datasheet system we created. For example, the content obtained by {$info ['form']} {$info [' tips']} in the code {$info ['form']} is the form style created by default for us by the system corresponding to the current field, as an example is shown below. The value in the following figure is the result of printing $info directly:

(5) the last thing to pay attention to is

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