Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB