我想動態地在yii中創建cactiveform中的文本區域。但我得到錯誤,即「屬性」Verse.translation「未定義」如何在yii中創建CActiveForm中的動態文本區域
我有translation_text
字段,而不是translation
字段在我的分貝。其次$trans['translation_text']
顯示的是經文翻譯,但是當我將它保留在textArea中時,它給出了錯誤。正如我所描述的那樣。
我有一個代碼。
<?php foreach($model->verseTranslations as $trans) { ?>
<?php $model->translation = $trans['translation_text']; ?>
<?php echo $form->textArea($model,'translation',array('rows'=>6, 'cols'=>50)); ?>
<?php } ?>
但我不知道如何保持價值$trans['translation_text']
在textarea的。
任何幫助將不勝感激。
感謝
「我得到的錯誤」是不是很豐富。更加詳細一些。 – Jon