Yii2 - 数据未到达 vova07 / yii2-imperavi-widget(文本区域)
Yii2 - Data Not Coming To vova07 / yii2-imperavi-widget (textarea)
我刚刚通过 php composer.phar require --prefer-dist vova07/yii2-imperavi-widget "*".
安装了 vova07 / yii2-imperavi-widget
而且,它可以很好地将任何内容插入数据库 table。但是,在将数据提取到这个小部件中时,我处于尴尬的境地
我要获取数据。所以,我创建了一个 'value' => $postDetails['desc']
。 数据未到达。
<?= $form->field($modelEditPost, 'desc')->widget(Widget::className(), [
'settings' => [
'value' => $postDetails['desc'],
'lang' => 'ru','minHeight' => 200,'plugins' => ['clips','fullscreen']]
]);?>
但是,当我包括
<?= $form->field($modelEditPost, 'desc')->textarea(['rows' => 6,'value'=>$postDetails['desc']]) ?>
(以前用于获取数据)与小部件一起,数据进入小部件(但是,不在文本区域中))
<?= $form->field($modelEditPost, 'desc')->textarea(['rows' => 6,'value'=>$postDetails['desc']]) ?>
<?= $form->field($modelEditPost, 'desc')->widget(Widget::className(), [
'settings' => [
'value' => $postDetails['desc'],
'lang' => 'ru','minHeight' => 200,'plugins' => ['clips','fullscreen']]
]);?>
实际上,我希望将数据提取到小部件中。
请帮我解决这个问题。
使用$modelEditPost->desc = $postDetails['desc']
:
$modelEditPost->desc = $postDetails['desc'];
<?= $form->field($modelEditPost, 'desc')->widget(Widget::className(), [
'settings' => ['lang' => 'ru','minHeight' => 200,'plugins' => ['clips','fullscreen']]
]);?>
我刚刚通过 php composer.phar require --prefer-dist vova07/yii2-imperavi-widget "*".
安装了 vova07 / yii2-imperavi-widget
而且,它可以很好地将任何内容插入数据库 table。但是,在将数据提取到这个小部件中时,我处于尴尬的境地
我要获取数据。所以,我创建了一个 'value' => $postDetails['desc']
。 数据未到达。
<?= $form->field($modelEditPost, 'desc')->widget(Widget::className(), [
'settings' => [
'value' => $postDetails['desc'],
'lang' => 'ru','minHeight' => 200,'plugins' => ['clips','fullscreen']]
]);?>
但是,当我包括
<?= $form->field($modelEditPost, 'desc')->textarea(['rows' => 6,'value'=>$postDetails['desc']]) ?>
(以前用于获取数据)与小部件一起,数据进入小部件(但是,不在文本区域中))
<?= $form->field($modelEditPost, 'desc')->textarea(['rows' => 6,'value'=>$postDetails['desc']]) ?>
<?= $form->field($modelEditPost, 'desc')->widget(Widget::className(), [
'settings' => [
'value' => $postDetails['desc'],
'lang' => 'ru','minHeight' => 200,'plugins' => ['clips','fullscreen']]
]);?>
实际上,我希望将数据提取到小部件中。
请帮我解决这个问题。
使用$modelEditPost->desc = $postDetails['desc']
:
$modelEditPost->desc = $postDetails['desc'];
<?= $form->field($modelEditPost, 'desc')->widget(Widget::className(), [
'settings' => ['lang' => 'ru','minHeight' => 200,'plugins' => ['clips','fullscreen']]
]);?>