• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routing

#1
[eluser]Steve Goodwin[/eluser]
Hi All,

I'm currently suffering a mind block on how I solve this problem.

I have HMVC installed and i'm using phil sturgeons setup of modules:

http://philsturgeon.co.uk/blog/2009/07/C...odeIgniter

The problem I'm facing is I have a product module, but this module could be used on multiple pages since the client has a products section and a used products section. One section sells products the other is just a catalogue, but I don't want to build the same functionality twice since in order to overcome the product not being for sale there are just a selection of radio buttons set to "For Sale" / "Not for Sale".

Anyway the problem is I will not know the URL for the page the module is on, nor will there be anything distinct in the url which will point to the module such as "products" etc.

The url structure will be:

http://www.example.com/{content-slug}/{c...uct-slug}/

My database has a content_tbl which stores all the pages content with the content slug in that table. The Category table has the categories which have their own slugs and the product table which stores there own slugs.

So each slug is in a different table and as far as the url is concerned at the moment product categories and products don't exist.

How would I:

a) Determine weather a product category is in the url, since this is modular I don't really want to hardcode this into the pages module or a core controller.
b) Determine weather a product name is in the url, and again since this is modular I don't really want to hardcode this into the pages module or a core controller.

Your help will be much appreciated.

Cheers

Steve


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.