Welcome Guest, Not a member yet? Register   Sign In
using ci to route domain.com/variable_here ?
#9

[eluser]tkyy[/eluser]
hey friends, i am having some bit of problems with this again (sorry to nag), here is what i am using:

Code:
$route['default_controller'] = "welcome";
$route['scaffolding_trigger'] = "";

/*
|---------------------------------------------------------------
| ALLOWING DOMAIN.COM/USERNAME (CUSTOM ROUTES)
|---------------------------------------------------------------
|
| Here we will perform a scandir of all of the controllers that
| we have in the project and manually route them. After that,
| we just make a custom route (last) to the user/show_profile
| function. This allows users to have subdirectory-style
| pages that are much easier to share and to remember.
|
*/

$controllers = scandir(absolute().'system/application/controllers/');
        
foreach($controllers as $item){
    if(stristr($item,'.php')){
        $route[str_replace('.php','',$item).'/(:any)'] = str_replace('.php','',$item).'/$1';
    }
}

$route['(:any)'] = 'user/show_profile/$1';

and im getting the dreaded white screen. can someone shed some light?


Messages In This Thread
using ci to route domain.com/variable_here ? - by El Forum - 07-13-2010, 10:36 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-14-2010, 06:56 AM
using ci to route domain.com/variable_here ? - by El Forum - 07-14-2010, 05:45 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-14-2010, 07:03 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-14-2010, 07:13 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-22-2010, 06:49 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-22-2010, 06:58 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-24-2010, 06:57 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-25-2010, 01:25 AM
using ci to route domain.com/variable_here ? - by El Forum - 07-25-2010, 10:33 AM
using ci to route domain.com/variable_here ? - by El Forum - 07-25-2010, 12:27 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-25-2010, 02:09 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-25-2010, 02:17 PM
using ci to route domain.com/variable_here ? - by El Forum - 07-25-2010, 02:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB