问:数据库里加一列,怎么让它在create里可操作..

我其实想知道yii控制流程…新手唉,新的model的createAction里主键没有的,比如

Orders(K:orderID,title,client…),create new orders: 表单里没有orderID我加了后,现在问题是:Please fix the following input errors:orderID cannot be blank. (我明明填了的)

求教啦!

你需要重写safeAttributes()把orderID列进去,因为缺省情况下主键是不允许批量赋值的。

谢谢!非常感谢及时回答了我呵呵,继续学习yii~