The CI framework supports two implementation methods: $ _ GET. ci_get
This article describes two methods for implementing the CI framework to support $ _ GET. 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/jb51/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/jb51/func? X = a & y = B.