thinkphp I (), U (), $this->post () and other function usages _php instance

Source: Internet
Author: User
Tags php template smarty template

The examples in this article describe the use of functions such as I (), U (), $this->post () in thinkphp. Share to everyone for your reference. The specific methods are as follows:

The following methods can be used to accept data from a form in a thinkphp in a controller:

1, $_post[]/$_get[], but this accepted form content is not filtered through the Htmlspecialchars () function. If you want to use this receive data, you need to process the form data manually

2, can be used to receive form functions

Copy Code code as follows:
$this->_post (); $this->_get ();
, this function is filtered by default using Htmlspecialchars () without manual filtering.

3, in the thinkphp3.1.3 has a new function I (); Receive form data directly and default to Htmlspecailchars (); Filter this function to have these fields I (' Required table single-name ', ' If the data is null default ', ' use the function to process the form data ') ;

U (); function is output address

U (' Operation name ', ' array () parameter ', ' pseudo static suffix name ', whether jump, domain name)

More interested in thinkphp related content readers can view the site topics: "thinkphp Introductory Course", "thinkphp Template Operation Skills Summary", "thinkphp Common Methods Summary", "Smarty Template Introductory Course" and "PHP template technology Summary."

I hope this article will help you with the PHP program design based on thinkphp framework.

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.