0

したがって、この URL に配置されます (例として):http://localhost/codeigniter-app/en/results?search_query=data

uri_string必要なパスを返さない

["uri_string"]=>
  string(10) "en/results"

そして予想される:

["uri_string"]=>
  string(10) "en/results?search_query=data"

私のいくつかconfig.php

$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
$config['allow_get_array']      = TRUE;
$config['enable_query_strings'] = false;

何か案は?

編集:

http://codeigniter.com/wiki/CodeIgniter_2.1_internationalization_i18nライブラリを使用すると問題が発生します

4

3 に答える 3

1

クエリ文字列がオフになっています-前回CIを使用したとき(1.7.xに戻ったとき)、それらは無視されました。それらをオンにしてみてください:

$config['enable_query_strings'] = true;

于 2012-02-24T23:20:10.437 に答える
1

I believe you'll have to use $this->input->get() to access the query string which, based on your example, would produce:

array(1) { ["search_query"]=> string(4) "data" }

Also, it's worth including this from the documentation:

Please note: If you are using query strings you will have to build your own URLs, rather than utilizing the URL helpers (and other helpers that generate URLs, like some of the form helpers) as these are designed to work with segment based URLs.

于 2012-02-25T16:15:06.803 に答える
0

application/core/MY_Lang.php正しいパスを取得する必要がある場所にこれを追加しました。

if(preg_match('/results/', $this->uri))
{
    $this->uri = $this->uri.'?'.$_SERVER['QUERY_STRING'];
}

怒鳴る:$this->uri = $URI->uri_string();

于 2012-02-27T00:25:29.523 に答える