How can i recieve the value in a controller from the following URL in codeigniter
http://localhost/directory/c_service/get_radius/lang=123
controller:
class C_service extends CI_Controller {
function __construct()
{
parent::__construct();
}
public function get_radius()
{
i need to get the vLUE 123 here
like,
`$value=$get['lang'];`
}
Thanks
In Codeigniter you can simply do
So your link could be simplified to
http://localhost/directory/c_service/get_radius/123if you don’t want to do something likeexplode('=', $lang)to get your value.You should however also consider adding a default value
public function get_radius($lang=0)if the link is opened without a parameter.Adding more variables is as easy as
public function get_radius($lang, $other)forhttp://localhost/directory/c_service/get_radius/123/other