Use of the u method in tp, use of the tpu method _ PHP Tutorial

Source: Internet
Author: User
The use of the u method in tp and the tpu method. The use of the u method in tp, tpu method has never used this method when using self-taught, and now I just entered a new company to participate in the project. We found that this method is used a lot, so we recorded the use of the u method in tp, and the use of the tpu method.

I have never used this method during my self-study. now I am entering a new company to participate in the project. This method is often used, so it should be recorded to prevent future forgetting.

The U method is used to assemble the URL address. the feature is that the corresponding URL address can be automatically generated based on the current URL mode and settings. the format is:

U ('address', 'parameters', 'pseudo-static ', 'redirect?', 'display domain name ');

1 // for example, the operation is successfully redirected to the lists method 2 $ this-> success ('newly added success', U ('strore/Ump/lists') in the Ump controller of the Store module '));
1 // 2 $ this-> success ('added successfully', U ('store/Ump/lists ', 'type = 1 & id = 1 '));

When using the U method in a template, the advantage is that once your environment changes or the parameter settings change, you do not need to change any code in the template.

The call format in the template must use {: U ('address', 'parameters '...)} Method

 {: U ('store/Ump/lists', 'type = 1 & id = 1 ')}

I did not use this method when I was a self-taught employee. now I am entering a new company to participate in the project. I found that this method is used a lot, so I recorded 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.