Configuration for a "table" Prefix

Maybe there should be a configuration-Parameter "tablePrefix".

All mappings should use <tablePrefix><className>.

Otherwise it would be more complicated to install two Yii-Blogs into the same database.

Maybe it would help in other cases, too.


Probably it is simpler to subclass AR with ovewriting tableName(), inheriting all own ARs from such subclass.


I made a parameter and changed <Model>::model()->tableName() to use the Parameter.

But I had to change some lines of hardcoded Tablenames in the BlogDemo.


I think there should be useful to add some boolean parameter like $useTablePrefix or maybe better string. For example, If your application is integrated with some forum and uses its "Users" table and application's tables prefix differ from your forum tables prefix

There are plenty one-line-solvable usefull things. Must we fill in the framework with them?  ;D

I agree with anli. The tablePrefix parameter is an application-level concept which should be solved in application-level code rather than in framework-level. If we provide this in framework, you may enjoy the convenience, but at the same time you and other users also need to learn more.

For the blog demo, a base AR class could be written which reads an application parameter about tablePrefix.