Difficulty with two segments of uri

0

They are trying to create the url, where the first segment is the user and the second is his file, eg link

Controller

public function user() {

    $user_url = $this->uri->segment(1);

}

^ This would return the profile with all files: link

public function arquivo() {

    $arquivo_url = $this->uri->segment(2);

}

^ This is the specific file: link

Routes

$route['(:any)'] = 'home/user/$1';
$route['??'] = 'home/arquivo/$1';
    
asked by anonymous 18.10.2014 / 21:49

1 answer

1

Getting the solution would be something like

$route['([^/]+)'] = 'home/user/$1';
$route['(:any)/(:any)'] = 'home/arquivo/$1';
    
18.10.2014 / 23:04