Php 动态id的代码点火器路由
如何为具有动态id的URL路由到特定URL。假设原始URL为Php 动态id的代码点火器路由,php,url-routing,codeigniter-routing,Php,Url Routing,Codeigniter Routing,如何为具有动态id的URL路由到特定URL。假设原始URL为 http:localhost/c2c/init/product/5 // here 5 is the id of the product. 在route.php中 但当输入原始URL时,它不会路由到http:localhost/c2c/product/iphone on sale。您可以尝试此方法 $route["product/iphone-on-sale/(:num)"] = "init/product/$1"; 您
http:localhost/c2c/init/product/5 // here 5 is the id of the product.
在route.php中
但当输入原始URL时,它不会路由到http:localhost/c2c/product/iphone on sale。您可以尝试此方法
$route["product/iphone-on-sale/(:num)"] = "init/product/$1";
您的url将是
http://localhost/c2c/product/iphone-on-sale/5
http://localhost/c2c/product/iphone-on-sale/5