在代码点击器中启用查询字符串 [英] Enable Query Strings in Code Igniter
问题描述
我试图在我的代码Igniter Web应用程序中实现Twitter的OAuth,回调URL是 / auth /
,所以一旦你通过Twitter验证, code> / auth /?oauth_token = SOME-TOKEN 。
我想保留漂亮的网址框架提供使用 / controller / method /
样式的URL,但是我也要启用查询字符串,只会有一个数据的名称 oauth_token
所以如果它必须硬编码是确定。
任何想法?
我尝试了大量的人都在说的事情,但没有工作:(
PS:我使用的URL重写的.htaccess方法。
大多数人,和Elliot Haughin的Twitter Lib,扩展了具有
MY_Input
库的库,它将 allow_query_strings
设置为 true
您还需要将?
config / config.php
中的字符并将$ config ['url_protocal']设置为 PATH_INFO
I am trying to implement Twitter's OAuth into my Code Igniter web application at which the callback URL is /auth/
so once you have authenticated with Twitter you are taken to /auth/?oauth_token=SOME-TOKEN
.
I want to keep the nice clean URL's the framework provides using the /controller/method/
style of URL but I want to enable query strings as well, there will only ever be one name of the data oauth_token
so it's ok if it has to be hard coded.
Any ideas? I have tried tons of the things people are saying to do, but none work :( PS: I'm using the .htaccess method of URL rewriting.
There are several ways to handle this.
Most People, and Elliot Haughin's Twitter Lib, extend the CI_Input
library with a MY_Input
library that sets allow_query_strings
to true
You will also need to add ?
to the allowed characters in config/config.php
and set $config['url_protocal'] to PATH_INFO
see here: Enable GET in CodeIgniter
这篇关于在代码点击器中启用查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!