我有一个页面,用户可以发表评论。为了增加用户的参与度,我想让他们输入他们的评论,即使他们没有登录/注册,只有在他们提交后才登录。Yii在登录之前保存表单
什么是实现这一目标的最佳/标准方法?
目前,访问登录页面只,我使用Yii的loginRequired
方法,Redirects the user browser to the login page. Before the redirection, the current URL (if it's not an AJAX url) will be kept in {@link returnUrl} so that the user browser may be redirected back to the current page after successful login.
但是,这仅保存URL,而不是POST数据时。
在附注中,我使用Yii-Rights。
http://www.yiiframework.com/doc/api/1.1/CActiveRecord#onBeforeFind-detail或http://www.yiiframework.com/doc/api/1.1/CModel#onBeforeValidate-detail不知道虽然但你试试这些。 –