我有一個頁面,用戶可以發表評論。爲了增加用戶的參與度,我想讓他們輸入他們的評論,即使他們沒有登錄/註冊,只有在他們提交後才登錄。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不知道雖然但你試試這些。 –