Activation Routes |
[eluser]xtremer360[/eluser]
After a user registers on my site they are sent an email containing a link to my activation controller. The link comprises of the siteurl.com/activation/$user_id/$activation_key. I'm trying to figure out if these are the proper routes I need for the activation page. I also included what the index function line starts with? Code: $route['activation/(:num)/(:any)'] = 'activation/index/$1/$2'; Code: public function index( $user_id = NULL, $registration_key = NULL )
[eluser]PhilTem[/eluser]
As long as you got a controller called activation it would be easier to do the following: routes: don't alter controller 'activation' Code: class Activation extends CI_Controller {
[eluser]xtremer360[/eluser]
But if the activation is good then I want it to display a view though.
[eluser]xtremer360[/eluser]
Here's my new updated Activation controller. Verify that the remap looks good and what I want is display a view with a specified message regardless of if it was good or not. Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]PhilTem[/eluser]
Yeah, you almost got it correctly However, you might want to take an even closer look at this user's guide topic http://codeigniter.com/nightly_user_guid...tion-calls describing the usage and idea behind the _remap() method. Basically, all you would need to do is putting you index()-method code inside the _remap()-method.
[eluser]xtremer360[/eluser]
That's great. Are you sure this is all I needed to do? Code: <?php
[eluser]PhilTem[/eluser]
I'm like 99.9999% sure it will work - assuming your code for activation is correct
[eluser]xtremer360[/eluser]
So what I"m trying to do is with the general message is have it display a message for each reason why it could or could not be validated with the two paramters. In my general_message view I have a <?php echo $message ?> that I need passed. Also at this point if one of the parameters or both of them are not included in the url it does not show the error page. Any ideas why? Code: <?php
|
Welcome Guest, Not a member yet? Register Sign In |