Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.53 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Codeigniter user profile URL
  2. class user extends CI_Controller {
  3.  
  4.     public function __construct(){
  5.         parent::__construct();
  6.     }
  7.  
  8.     public function index($username = null){
  9.         //load index page
  10.         $this->load->view('profile/index');
  11.     }
  12.  
  13. }
  14.        
  15. //user profiles pretty url
  16. $route['user/(:any)'] = "user/index/$1";
  17.        
  18. $route['controller'] = "controller";
  19. $route['controller/(:any)'] = "controller/$1";
  20. $route['(:any)'] = "user/$1";
  21.        
  22. public function _remap($username = null) {
  23.     $this->load->view('profile/index');
  24. }