Mysql-thinkphp3.2.2 A AdminController. class. php contains N methods of the same class, how to separate them

Source: Internet
Author: User
There are N methods of the same class in an AdminController. class. php, and how to separate them. For example, can setUser, deleteUser, and updateUser be separated into one file? For example, setMoney, deleteMoney, and updateMoney can be separated... An AdminController. class. php contains N methods of the same class and how to separate them.
For example, can setUser, deleteUser, and updateUser be separated into one file?
For example, can setMoney, deleteMoney, and updateMoney be separated into one file?
How to create folders for separation. And how to reference them to AdminController. class. php. What should they do with their corresponding templates? Should they be changed?
Thank you!

Reply content:

There are N methods of the same class in an AdminController. class. php, and how to separate them.
For example, can setUser, deleteUser, and updateUser be separated into one file?
For example, can setMoney, deleteMoney, and updateMoney be separated into one file?
How to create folders for separation. And how to reference them to AdminController. class. php. What should they do with their corresponding templates? Should they be changed?
Thank you!

Background Management is not necessary.

If you really want to tell it out, there are two ways:

  1. Directly write those functions to several other files, require files. (Silly and not necessarily work)

  2. In routing, these pages are separated to different actions, which are similar to AdminController. Of course, the view supporting them must be separated.

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.