Difference between revisions of "Code Igniter"
From KOP KB
(→Forcing traffic to specific controller and method) |
(→Forcing traffic to specific controller and method) |
||
Line 2: | Line 2: | ||
=== Forcing traffic to specific controller and method === | === Forcing traffic to specific controller and method === | ||
− | Pretty much what were trying to do is make this url: <pre>https://www.domain.com/home/pages/about</pre | + | Pretty much what were trying to do is make this url: <pre>https://www.domain.com/home/pages/about</pre> |
− | Become This one: https://www.domain.com/about< | + | Become This one: <pre>https://www.domain.com/about</pre> |
In the routes file below put in: | In the routes file below put in: | ||
− | |||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$route['default_controller'] = 'home/pages'; | $route['default_controller'] = 'home/pages'; |
Revision as of 16:44, 20 May 2015
Contents
Route Related
Forcing traffic to specific controller and method
Pretty much what were trying to do is make this url:https://www.domain.com/home/pages/aboutBecome This one:
https://www.domain.com/about
In the routes file below put in:
$route['default_controller'] = 'home/pages';
$route['(:any)'] = 'home/pages';
Auth Related
Ion-Auth redirect back to original page
Somone goes to said controller and needs to login to it the get forced to the auth page:
example.com/index.php/dashboard
To make it go back there you need to put the following in the auth controller were you see comments to that says login sucessfully
redirect($this->session->userdata('refered_from'),"refresh");