简体   繁体   English

代码点火器:: $ _GET?

[英]code igniter :: $_GET?

In my projects i often use get params as a temporary way to test things with different values. 在我的项目中,我经常使用get params作为测试具有不同值的事物的临时方法。

However it seems like you cannot access get params in code igniter? 但是似乎您无法访问代码点火器中的获取参数?

I am aware I could build a param into my functions and pass the value as a url segment. 我知道我可以在函数中建立参数并将值作为url段传递。

But i dont want to be doing that every time I wish to test something. 但是我不想每次我想测试一些东西时都这样做。

So, 所以,

is there any way to use get values in CI? 有什么方法可以在CI中使用获取值?

您可以解析$_SERVER['QUERY_STRING']并将其设置为$_GET

parse_str($_SERVER['QUERY_STRING'], $_GET);

You can enable query strings in your config file. 您可以在配置文件中启用查询字符串。 Find this. 找到这个

$config['enable_query_strings'] = FALSE;

and change it to true. 并将其更改为true。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM