Common function call in ThinkPHP5

Source: Internet
Author: User
In ThinkPHP3.2.3, calling public functions is in the Common folder under the Application, for example, creating a function. php, where should I write public functions in ThinkPHP5? Is comm in the application folder... in ThinkPHP 3.2.3, calling public functions is in the Common folder under the Application, for example, creating a function. php. I wrote the public functions here.
Where should public functions be written in ThinkPHP 5? Is it in command. php in the application folder, or do I create a function. php file in the command folder under application? (It is strange that there is a command folder under the application folder in the official manual, but I don't have the command folder in the application folder, so I created a new one)

Reply content:

In ThinkPHP 3.2.3, calling public functions is in the Common folder under the Application. for example, if I create a function. php, I write the public functions here.
Where should public functions be written in ThinkPHP 5? Is it in command. php in the application folder, or do I create a function. php file in the command folder under application? (It is strange that there is a command folder under the application folder in the official manual, but I don't have the command folder in the application folder, so I created a new one)

It indicates that you have not started to study tp5 yet. however, to express your respect and gratitude for the invitation of the subject, you can download it immediately. This may be due to the fact that it is still in the testing stage; before the official version is released, you can put the user-defined function in/thinkphp/helper. php file;

In TP5, common functions and manually registered routes are all stored in\ Application \ common. php

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.