The URL that is generated when the get submits form in the YII framework is related to the problem.

Source: Internet
Author: User
URL problem generated when get submit form in Yii framework ....
The URL is similar to when you submit a form with get www.baidu.com/index.php/test?id=12

What's in the back? id=12

Would like to ask under the PHP or YII framework, there is a way to submit the form to get the URL into WWW.BAIDU.COM/INDEX.PHP/TEST/ID/12

Id=12 became/ID/12.

Please give a help to the little brother.
I'm using the YII framework.
------Solution--------------------
In the form submission, is a get URL constructed by JavaScript

/INDEX.PHP/TEST/ID/12 is a routing rule for yii itself, which can be modified in the following file:
protected/config/main.php
Uncomment line 41st to 48th, which will use a INDEX.PHP/TEST/ID/12-like routing rule.

This way, you submit a form to the current PHP app, and the associated JavaScript will reorganize the get URL.
------Solution--------------------
Reference Curlmanager the access path by default is Index.php?r=index (Controller)/A (ACTION)/parameter 1/data 1/Parameter 2/Data 2

If you want to get rid of index.php?r=xxx. Configure the routing management class in main.php specifically look at the basic introduction of the above class and then change it. 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.