PHP Optimized Link, using/passing parameter classes

Source: Internet
Author: User
Isn't he using a traditional one? Page = 20 use question marks to pass parameters, which is both not beautiful and unfriendly to search engines. Therefore, we can use the/method to pass parameters.

We often see this link.

Http: // www. *****. com/RequestPath. class. php/edit/trackbacks/page/2/Flag/4

Isn't he using a traditional one? Page = 20Using question marks to pass parameters is neither beautiful nor friendly to search engines,

So we can use/To pass parameters.


Instructions for use:

In the above example

EditIs action, through_ Get("Action") To obtain

TrackbacksYes._ Get("Type") To obtain


All of them are one-to-one, which can be any number of pairs, such as

_ Get("Page") The value is2

_ Get("Flag") The value is4

 
 
 Parts = $ parsed ;} /************************************ function name: __get _ set _ isset function: get, set, and test path element planting parameters $ key: parameter name ************************************** */public function _ get ($ key) {return $ this-> parts [$ key];} public function _ set ($ key, $ value) {$ this-> parts [$ key] = $ value ;} public function _ isset ($ key) {return isset ($ this-> parts [$ key]) ;}}?>

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.