CIURL can be defined in this way. The final result of this post is "controller & nbsp;: & nbsp; apimethod & nbsp;": & nbsp; index in this method, I want to use GET to pass a parameter, the URL CI URL can be defined as not
At the end of this post, wdvill edited controller: api at 02:57:39 on
Method: index
In this method, I want to use GET to pass a parameter. the URL is as follows. The result is not acceptable and error 404 is returned. why?
Http: // localhost/codeigniter/index. php/api/index? Param = 12
But I put? After the number is removed
Http: // localhost/bubblewitch/index. php/api/index
But I want to input the parameter.
You can use http: // localhost/codeigniter/index. php/api/index/param/12
But I don't want this.
I asked if I want to use the first tape? In the CI framework, there is a way to achieve
------ Solution --------------------
The routing function is used in CI, that is, the route under the config file of the user. set your own routing rules in php. you can see $ route ['thumb/(: any) '] = "category/thumb/$1"; can this array be adjusted, become the way you want
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.