How to allocate data in the Public template file in ThinkPhp

Source: Internet
Author: User
In ThinkPhp, how does one allocate data in the Public template file ,??? I don't understand what it means. it seems that the value is assigned to the controller. it can be used. If many pages are used, values are assigned directly to the controller of the parent class. Or use hooks or something like that. my previous solution was to create a Public CommonAction. class. php in the action, and then how to allocate data in the Public template file in ThinkPhp on the page.

------ Solution --------------------
??? I don't understand what it means
------ Solution --------------------
It seems that the value is assigned to the controller, which can be used.
If many pages are used, values are assigned directly to the controller of the parent class. Or use a hook or something.
------ Solution --------------------
My previous solution was to create a public CommonAction. class. php in the action.
Then the page inherits from it, and the public data can be retrieved in it.

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.