Server Side/PHP

[코드이그나이터] 세그먼트 라이팅 매핑 (파라미터)

Dev. Tool 2019. 12. 5. 09:55
S/N URL Route Controller Method
1 / $route['default_controller'] Welcome index
2 /contacts $route['contacts'] Contacts index
3 /contacts/create $route['create'] Contacts create
4 /contacts/edit/id $route['edit/:id'] Contacts edit
5 /contacts/update/id $route['update/:id'] Contacts update
6 /contacts/delete/id $route['delete/:id'] Contacts

dele

 

$route['default_controller'] = 'welcome'; $route['contacts'] = 'contacts'; $route['create'] = 'contacts/create'; $route['edit/:id'] = 'contacts/edit'; $route['update/:id'] = 'contacts/update'; $route['delete/:id'] = 'contacts/delete'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE;

 

S/N Route Corresponding URL
1 $route['default_controller'] = 'welcome'; http://localhost:3000
2 $route['contacts'] = 'contacts'; http://localhost:3000/contacts
3 $route['create'] = 'contacts/create'; http://localhost:3000/contacts/create
4 $route['edit/:id'] = 'contacts/edit'; http://localhost:3000/contacts/edit/1
5 $route['update/:id'] = 'contacts/update'; http://localhost:3000/contacts/update/1
6 $route['delete/:id'] = 'contacts/delete'; http://localhost:3000/contacts/delete/1