Welcome Guest, Not a member yet? Register   Sign In
Help for htacces or routing
#1

I have this scenario:

One controller called Brands with relative class Brands.
Inside this controller the following functions:

index() - This is showing the list of all brands inside my db
show($slug) - This is showing the detail of the brand clicked and all list of the products related with that brand.
detail($slug) - This is showing the detail of one product belonging to the previous product list

When I call index, as normal, I have a url like that:

- http://localhost/brands

When I click on a brand of this list, I have an url like that:

- http://localhost/brands/show/apple

When I click on a product of this list, I have an url like that:

- http://localhost/brands/detail/macbook-13-retina

I would like to have previous urls in this form:

- http://localhost/brands
- http://localhost/brands/apple
- http://localhost/brands/apple/macbook-13-retina

Now, I've read a lot of tutorials and I've read how to routing library works, but
I can't understand if routes can help me more than a htaccess.
Also, the cms I'm building can be installed with a different language than English, so I can have
for example:

- http://localhost/brands but as well
- http://localhost/marcas or
- http://localhost/marche

How can I use routing or htaccess for to get the above changes?

Can someone help me? Thank you very much in advance...

Giorgio
Reply


Messages In This Thread
Help for htacces or routing - by gbwebapps - 04-07-2017, 03:46 PM
RE: Help for htacces or routing - by PaulD - 04-07-2017, 04:08 PM
RE: Help for htacces or routing - by gbwebapps - 04-07-2017, 04:11 PM
RE: Help for htacces or routing - by PaulD - 04-07-2017, 04:20 PM
RE: Help for htacces or routing - by gbwebapps - 04-08-2017, 10:16 AM
RE: Help for htacces or routing - by gbwebapps - 04-12-2017, 01:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB