Welcome Guest, Not a member yet? Register   Sign In
Codeigniter, linking to dynamic URLS
#1

[eluser]Unknown[/eluser]
All my routing is done with a database so my urls are dynamic.
However, i would still like to be able to link to them, but to do that, I need your help.

Currently my routes look like this:
Code:
Array
(
    [default_controller] => user/create
    [404_override] =>
    [create/success] => user/create/success
    [create] => user/create
    [administrator] => administrator/dashboard
    [login] => user/login
    [logout] => user/logout
    [administrator/editor] => administrator/editor
    [administrator/clients] => administrator/clients
    [administrator/client/(:num)] => administrator/clients/client/$1
)

I'm looking to create a function where i input the link to the controller.
It could be:
Code:
echo url_real('administrator/clients/client/11'); // returns: administrator/client/11

My theory is that i first match the varible with all the array's values, and after that, matches all the $1, $2, $3 with the array's keys.
And after that return the dynamic url.


Messages In This Thread
Codeigniter, linking to dynamic URLS - by El Forum - 07-21-2014, 11:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB