Welcome Guest, Not a member yet? Register   Sign In
Divide URI segment into 2 parts through routes.php
#8

[eluser]CroNiX[/eluser]
Code:
//pass it to a method in your controller, not just the controller (unless using _remap())
$route['aaa-(:any)'] = "aaa/process/$1";

class aaa extends CI_Controller
{
  //receive parameter 1 passed from the route into the process() method
  //(with a default of empty string so no error going to http://yoursite.com/aaa))
  function process($parameter1 = '')
  {
    if($parameter1 == '')
    {
        $parameter1 = 'Not Set';
    }
    echo 'parameter1: ' . $parameter1;
  }
}


Messages In This Thread
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 03:24 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 08:08 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 08:29 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 11:04 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 11:06 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 12:18 PM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 12:24 PM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-30-2012, 01:42 PM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 03:05 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 03:19 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 03:31 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 03:33 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 03:41 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 05:29 AM
Divide URI segment into 2 parts through routes.php - by El Forum - 01-31-2012, 05:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB