• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changing session based on route

#1
Hi!

I was wondering if anyone could help me:

I have the following

controller/function

I want to make a route that goes:

{some_text}/controller/function  routes to controller/function

The only difference is that the value of some_test willl change a config/session/global variable in the controller.

So something in route, or construct of the controller that can extract the some_text and set it in the session?

Thanks in advance!
Reply

#2
After routing you do have access to the routed segments:

https://www.codeigniter.com/userguide3/l...::rsegment
Reply

#3
Ah that makes sense! Though I should mention, after testing, clearly rsegment is the routed segment as you said, though in this case I wanted the segment that is in the URL in the user's browser to set the session Smile
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.