Another reason to go more 'traditional'?
Hi again,
Got back in to this again and moved forward a little. Got another issue and possibly another reason to go more 'traditional' on data design ... here it is:
My days of designing applications - admittedly not for the web but maybe environment is immaterial here - would lead me to start thinking about the entities in the application e.g. Categories, Subcategories & Products (so far, only on page 95 at the moment) and I would, by nature have defined them thus:
Categories table
----------------
CatId - primary key
CatDesc
CatStatus
etc.
Subcategories table
-------------------
CatId - primary key
SubcatId - primary key
SubcatDesc
SubcatStatus
etc.
Products table
-------------------
CatId - primary key
SubcatId - primary key
ProductId - primary key
ProductDesc
ProductThumb
ProductStatus
etc.
Now I can appreciate that changing the getSubCategories() in the mcats model demonstrates how easy it is to make changes that may have otherwise been considered more than trivial but ...
... going the 'traditional' route I refer to above, you would simply have to add an element to each of the Categories & Subcategories tables - a thumbnail - then your problem is solved purely, without any 'tricksy' code and you wouldn't have to reference the products table in the categories model to simply 'wrestle' with the data to make it do what you want it to do. Ok so you need another model for the Subcategories table but that's no hardship, right?
I'm new to MVC and Codeigniter so I could have this all (a) about (f) ...
any thoughts anyone?
P.S.
when I click on a link in the navbar I keep getting a 'The requested URL /ci/welcome/cat/7 was not found on this server.' message.
The link in the navbar points to 'http://localhost/ci/welcome/cat/7' as it should ... any ideas as to why the error keeps occurring?
Last edited by patch; August 3rd, 2009 at 03:06 PM..
|