Difference between revisions of "Code Igniter"

From KOP KB
Jump to: navigation, search
(Ion-Auth redirect back to original page)
Line 16: Line 16:
 
==Auth Related ==
 
==Auth Related ==
 
== Ion-Auth redirect back to original page ==
 
== 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:
+
Somone goes to said controller and needs to login to it the get forced to the auth page:<br><br>
example.com/index.php/dashboard
+
example.com/index.php/dashboard<br><br>
 +
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
 +
<syntaxhighlight lang="php">
 +
redirect($this->session->userdata('refered_from'),"refresh");
 +
</syntaxhighlight>
  
To make it go back there you need to put the following
+
Source:
 +
http://stackoverflow.com/questions/18903315/redirect-to-previous-page-after-login-ion-auth-codeigniter

Revision as of 16:26, 20 May 2015

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/about
Become This one: https://www.domain.com/about

In the routes file below put in:

$route['default_controller'] = 'home/pages';
$route['(:any)'] = 'home/pages';

Source: http://stackoverflow.com/questions/30338589/codeigniter-force-all-traffic-to-specific-controller-and-method

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");

Source: http://stackoverflow.com/questions/18903315/redirect-to-previous-page-after-login-ion-auth-codeigniter