Reputation: 1527
How to code or achieve this url like wordpress
for example
http://www.example.com/product/view/my-product-sample
is there way to have this url ? any tips tutorial example thank you guys :)
Upvotes: 0
Views: 1047
Reputation: 102854
Well, this is already a valid URL without any alteration, calling the controller product
, method view
with the argument my-product-sample
.
However, I think you are looking for routing.
Example:
$route['product/view/(:any)'] = 'products/view_product/$1';
This route is saying: If user requests
product/view/(something)
give them
products/view_product/(something)
As usual, see the user guide for more information.
Upvotes: 1