Help and suggestions for making a short URL structure? |
12-02-2017, 08:16 AM
(This post was last modified: 12-02-2017, 01:29 PM by PaulD. Edit Reason: Added PS )
I was thinking about a pre-system hook to change the routing. So I could look up the first segment, and somehow reset the controller called if necessary (not exactly certain how yet, but been looking through codeigniter.php and index.php for ideas).
So armed with this new idea I found this: https://stackoverflow.com/questions/2885...on-best-ap That suggests something like the following for a pre-system hook. (just tidied up the comments a bit, not changed anything else yet) Code: function set_controller() That looks like it has potential as a way to go. I also had a look at the routing where it throws an error if the controller is not found. I was tempted to do the lookups there and tamper with it but in truth, there are things it is doing in the php there I do not fully understand. (And tampering with these files is always a bad idea) I might give the above code a go, see if I can modify it to do what I need. Still causes me concern though as this is rapidly getting beyond my working knowledge of CI, and I do not want to cause massive issues further down the line with unforeseen side affects. Paul. PS This doesn't seem to be working. At least I have been unable to get this idea to work :-( |
Messages In This Thread |
Help and suggestions for making a short URL structure? - by PaulD - 12-02-2017, 04:53 AM
RE: Help and suggestions for making a short URL structure? - by ivantcholakov - 12-02-2017, 07:08 AM
RE: Help and suggestions for making a short URL structure? - by PaulD - 12-02-2017, 07:36 AM
RE: Help and suggestions for making a short URL structure? - by PaulD - 12-02-2017, 08:16 AM
RE: Help and suggestions for making a short URL structure? - by natanfelles - 12-02-2017, 12:21 PM
RE: Help and suggestions for making a short URL structure? - by PaulD - 12-02-2017, 01:27 PM
|