In the yii Framework, the URL generated when get submits a form is related.

Source: Internet
Author: User
URL issue generated when get submits a form in yii Framework ....... When submitting a form using GET, the URL is similar to www. baidu. comindex. phptest? What is behind id12? Id12: in the PHP or YII Framework, how can I change the URL to www. baidu. comindex. phptestid12 when the GET form is submitted ;? URL issue generated when the get form is submitted in the id12 yii Framework .......
When submitting a form using GET, the URL is similar to www.baidu.com/index.php/test? Id = 12

What is next? Id = 12

In PHP or YII Framework, how can I change the URL of the GET form to www.baidu.com/index.php/test/id/12?

Yes? Id = 12 is/id/12

Please help me.
I am using the YII Framework.
------ Solution --------------------
Form submission is a get url constructed by javascript.

/Index. php/test/id/12 is a routing rule of Yii, which can be modified in the following file:
Protected/config/main. php
Uncomment lines 41st to 48, and then use a routing rule similar to index. php/test/id/12.

In this way, when you submit the form to the current php application, the related javascript will reorganize the get url.
------ Solution --------------------
Refer to CUrlManager. the default access path is index. php? R = index (controller)/a (ACTION)/parameter 1/Data 1/parameter 2/Data 2

If you want to remove index. php? R = xxx configure the routing management class in main. php. Take a look at the basic introduction of the above classes and change. htaccess!

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.