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.com/index.php/test? Id = 12 followed? Id = 12: in PHP or YII Framework, how can I solve the URL issue generated when GET submits a form in the 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!
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.