This article mainly introduces two CI frameworks that support $ _ GET. The example analyzes the implementation skills of get and pathinfo methods, for more information about how to use the CI framework to support $ _ GET, see the following example. We will share this with you for your reference. The details are as follows:
First, the ci framework supports GET after 2.0, so there is no pressure to use it!
1. Use get to pass parameters:
CI will automatically pass the two parts that exceed the URI as parameters to the method. Go to the manual: CI framework Chinese manual
As follows: localhost/index. php/func/a/B
The php code in the Controller method is as follows:
<? Phpclass Jb51 extends CI_Controller {public function func ($ x, $ y) {echo $ x; echo $ y ;}}?>
As shown above: a and B are passed to the func method.
2. As you can imagine, if your parameter is too long, this method will definitely not work. OK, so do this:
Set 'uri _ Protocol' in config. php
$ Config ['uri _ Protocol'] = "PATH_INFO ";
Add
Parse_str ($ _ SERVER ['query _ string'], $ _ GET );
In this way, you can easily use index. php/func? X = a & y = B.