Sunday, 15 January 2012

php - How do I convert $_GET/$_POST params to URL segments in CodeIgniter? -



php - How do I convert $_GET/$_POST params to URL segments in CodeIgniter? -

very simple. how can convert this:

index.php/person/byage?age=5 or index.php/person/byage (with $_posted data)

to this:

index.php/person/byage/5

i using codeigniter 2.1.3

for specific issue shouldn't need edit .htaccess (if happy still include index.php in urls). have @ codeigniter uri class here

their documentation best thing framework imo, , explain of far improve could.

in particular out command:

$this->uri->segment();

this function allows homecoming particular segment of url. in case calling byage method of person controller. phone call $this->uri->segment(3); homecoming 5.

php codeigniter

No comments:

Post a Comment