I have a module named staff. So, I can call it as: test.com/staff, test.com/staff/save
I have used routes to use it for teacher, librarian etc. Like, test.com/teacher, test.com/librarian
I used $this->uri->segment(1) to get the staff type.
Now, while saving, I want all the inner functions to use test.com/staff/save and get staff type from uri segment.
But, when I save, I get uri segment as staff when save function is called instead of teacher or librarian.
In short, Module name = staff. Added routes for teacher, librarian etc.
Now, Browser URL = http://test.com/teacher
Save URL (using ajax) = http://test.com/staff/save
And while saving, I need to get browser segment as "teacher" so that I can get it as category but I get "staff" using $this->uri->segment(1).
How can I make it use the uri segment from the browser url link only instead of function call?