Welcome Guest, Not a member yet? Register   Sign In
Building Codeigniter URLs with variable segments
#4

[eluser]InsiteFX[/eluser]
Code:
------------- Segments    1          2          3            4
http://www.mysite.com/[outlets]/[city_name]/[area_name]/[outlet_name].

// outlets controller
public function index()
{
    // NOTE: The second parameter 0 is a default value.
    $city_name   = $this->uri->segment(2, 0);
    $area_name   = $this->uri->segment(3, 0);
    $outlet_name = $this->uri->segment(4, 0);
}

By default it will return FALSE if the segment is empty.

CodeIgniter Users Guide - URI Class


Messages In This Thread
Building Codeigniter URLs with variable segments - by El Forum - 06-09-2012, 12:56 PM
Building Codeigniter URLs with variable segments - by El Forum - 06-09-2012, 03:12 PM
Building Codeigniter URLs with variable segments - by El Forum - 06-09-2012, 04:50 PM
Building Codeigniter URLs with variable segments - by El Forum - 06-09-2012, 05:08 PM
Building Codeigniter URLs with variable segments - by El Forum - 06-10-2012, 02:45 AM
Building Codeigniter URLs with variable segments - by El Forum - 06-10-2012, 04:35 AM
Building Codeigniter URLs with variable segments - by El Forum - 06-10-2012, 11:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB