When using thinkphp3.2, most of the pages with additions, deletions, modifications and queries are basically similar. But it needs to be modified one by one, modifying the list fields, modifying the addition, and editing forms. Repeating the work needs to be done many times. Are there any good ideas for code reuse?
My front-end form verification generally uses jquery's validate. This code also requires writing verification code on each page. How do you do front-end verification and how to reuse the code?
Can anyone give me some advice? Better ideas and methods, thank you. How do you deal with these problems? Sometimes I feel that the front-end work is much more trivial than the back-end work.
代言2017-07-03 11:43:24
The p module in the front-end page. There may be many similar p blocks in a project. What you want is not to write them repeatedly, right? I personally think that the same parts can be directly encapsulated in js, by calling The encapsulated js is used to fill in the content of the response according to different identifiers in different places. However, if you want to save trouble, there should be more problems in this way. You must know what are required by many different identifiers. , as long as you don’t get confused yourself, but there is one thing. I don’t know how to write your comments. Whether others can understand it at a glance is also the key