iT邦幫忙

2

【Codeigniter】-Route設定-菜鳥日記(3)

\application\config->route.php

//這是要呼叫function
$route['api_shopping/(:any)'] = 'api_shopping/$1';
$route['check/(:any)'] = 'check/$1';
$route['console/(:any)'] = 'console/$1';
$route['(:any)'] = 'pages/$1';

//這是讓functiond可以帶一個參數
$route['(:any)/(:any)'] = 'pages/$1/$2';

//在上例中,"pages"類別(class)將被載入。
//儘量預設一個路由,否則預設會出現一個404頁面。
$route['default_controller'] = 'pages';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

尚未有邦友留言

立即登入留言