不要再 frontend 和 backend 下直接 use commom 中的 model。要在 frontend/models 和 backend/models 下建立model类分别继承 common/models,然后再use。 https://www.yiichina.com/doc/... 在高级应用模板, 你可以定义一个模型基类common\models\Post, 然后在前台应用中,定义并使用一个继承common\models\Post的具体模型类frontend\models\Post, 在后台应用中可以类似地定义backend\models\Post。 通过这种策略,你清楚frontend\models\Post只对应前台应用,如果你修改它, 就无需担忧修改会影响后台应用。
不要再 frontend 和 backend 下直接 use commom 中的 model。要在
frontend/models
和backend/models
下建立model类分别继承common/models
,然后再use。https://www.yiichina.com/doc/...