我正在通过API在我的网站上嵌入国旗图像&其他几个。自定义路由不工作| Codeigniter路由
我在3个参数取即
- 国家(国家名称 - ISO代码或全名)
- 尺寸(图像尺寸)
- 类型(样式,如平面标志,闪亮的圆国旗等)
现在,一切设置正确,但坚持处理URI。
Controller -> flags.php
Function -> index()
我现在拥有的是:
http://imageserver.com/flags?country=india&size=64&style=round
我想要什么
http://imageserver.com/flag/india/64/round
我通过一些文章去了,做这条路线,但所有这些失败
$route['flag/(:any)/(:num)/(:any)'] = "welcome/index/country/$1/size/$2/style/$3";
$route['flag/(:any)/(:num)/(:any)'] = "welcome/index/$1/$2/$3";
$route['flag/(:any)/(:num)/(:any)'] = "welcome/index?country=$1&size=$2&style=$3";