Welcome Guest, Not a member yet? Register   Sign In
add an ID automatically to URL
#2

(This post was last modified: 05-05-2015, 08:30 AM by nasser.man.)

i think it can be done in better way : new table that contains slugs for menu items :

table menu items :


Code:
ID     title            url                permission                parent_id  
--------------------------------------------------------------------------------------------
0       home         /default          any                          0
1       login          /users/login    unauthenticatd          0
2       logout        /users/logout  authenticated            0

....


table menu slugs :


Code:
ID          id_menu                    slug        
-----------------------------------------------------------------------
x           0                               home-page
x           0                               default-page
x           1                               login-page
x           2                               logout-me


in this case when user types one of this URLs, must be routes to /default controller :
/default
/home-page
/default-page

i think joomla uses same way (i think) , now my problem is " how i can get this rules from database and add them to config/routes.php dynamically at runtime,?
//----------------------------------------------------------
$route['home-page'] = 'default';
$route['default-page'] = 'default';
//----------------------------------------------------------
i use wiredesignz / codeigniter-modular-extensions-hmvc in my application,
ressan.ir
CI is nice Heart
Reply


Messages In This Thread
add an ID automatically to URL - by nasser.man - 05-04-2015, 11:04 PM
RE: add an ID automatically to URL - by nasser.man - 05-05-2015, 08:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB