0
我有這樣的代碼在我看來如何限制redactor限制器插件上的max char?
<div class="col-xs-6">
<?php echo $form->field($model, 'deskripsi_produk')->widget(Redactor::className(),['clientOptions'=>['autoresize'=>'true', 'limiter' => 20, 'plugins' => ['limiter'], 'buttons'=> ['html', 'formatting', 'bold', 'italic','underline','lists','horizontalrule'],]]);?>
</div>
它可以限制20個字符,但如何限制文本區域的模型來代替具體的數量限制定義最大字符串?
這裏是我的模型
class TbProduk extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public $image;
public static function tableName()
{
return 'tb_produk';
}
public function rules()
{
return [
...
[['deskripsi_produk'], 'string', 'max' => 2000],
[['deskripsi_produk'], 'checkDesc'],
...
];
}
}
哪裏是在模型中定義的最大長度? – topher
@topher問題已更新 –