Search code examples
phpcodeigniterurlurl-rewritingcodeigniter-url

How to pass controller name throught query string Codeigniter


How to pass when controller name is inside folder.

index.php?c=welcome

I tried this index.php?c=A/welcome which is not working.


Solution

  • The config file has this:

    $config['controller_trigger']   = 'c';
    $config['function_trigger']     = 'm';
    $config['directory_trigger']    = 'd'; 
    

    It says: "// experimental not currently in use"

    I looked at the Router class that handles this and it looks like it uses the value passed in ?d= to set the directory...you might want to try that.

    It would look like

    index.php?d=A&c=welcome