码迷,mamicode.com
首页 > 其他好文 > 详细

yii2中textarea中的默认值设置

时间:2014-09-12 14:57:33      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:style   color   使用   ar   for   sp   c   r   bs   

1. view中显示文本域的位置

    <?= $form->field($goods_model, ‘goods_introduce‘)->textArea([‘class‘=>‘intr‘,‘rows‘=>3]) ?>

2.要在该文本域中添加默认值,需要在view中设置,不能使用value="",textarea本身没有value属性设置

    $goods_model->goods_introduce=‘aaa‘;

最后,aaa将显示在文本域中作为默认值

yii2中textarea中的默认值设置

标签:style   color   使用   ar   for   sp   c   r   bs   

原文地址:http://www.cnblogs.com/xlz307/p/3968278.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!