Url Manager url from the root?

There are entities:
  1. Category (blog)
  2. Page (blog)
  3. Product category
  4. Product


They should open a url that leads from the root, without a prefix of type 'catalog' or 'blog' etc.

for example: site/news/page-1 (page page-1 where category_id points to category news)

In General, how to implement it ? (the generation of url parsing and routing)

My plan UrlManager:
To create a table:
id | url | src_id | type
where:
url - the full url from the root ( /news/page-1 )
src_id - the resource, which is due to open this link
type - the resource type enum ( 0 - page, 1 - blog-category, 2 - category 3 - goods), etc

Well, actually, to work with this table.

What do you say ?
Who faced prompt please how is better to implement it, what can be problem and etc?
Not too primitive, my version, not "vlob" does he ?

Thank you
April 3rd 20 at 17:38
1 answer
April 3rd 20 at 17:40
not "vlob" if he - the Decision "in a forehead" are often better crutches and perversions (when simple functionality is a huge swing packages).

If this solution suits you, it is clear and logical - use it. How to stop to miss that functionality you'll have to think about upgrade or rewriting, but with a clear vision of what you want from the new version.

Find more questions by tags Yii