I'm new in CodeIgniter and HMVC, and trying to make a web application The Structure I define is as follows
-Modules
-User
-Controllers
-Views
-Models
-Orders
-Controllers
-Views
-Models
-Bills
-Controllers
-Views
-Models
-Payments
-Controllers
-Views
-Models
...
The structure that I getting is
http://localhost/site/Orders/.. or http://localhost/site/bills/..
That I want is a structure depending of the user logged, like this
http://localhost/site/<currentuser>/Orders/
or
http://localhost/site/<iduser>/Orders/
How do I get this? I have read a lot of information and I dont know how to do it
I think "
http://localhost/site/
" is the base URL of your website.CodeIgniter routing pattern is as follows :
you want your URL call like this :
http://localhost/site/iduser/ControllerName/MethodName/Parameters/...
You can achieve this by using the bellow little hack in CodeIginter Core.
Replace $segments[0] with $segments[1]
OR
Add this code at line 270
$x=$segments; $a=1; for($i=0;$i<(count($segments)-1); $i++) { $segments[$i]=$x[$a]; $a++; }