Home >Backend Development >PHP Tutorial >YII表单输出问题

YII表单输出问题

WBOY
WBOYOriginal
2016-06-06 20:40:411070browse

先上我的模型验证:

<code>[
    ['content','title','excerpt'],
    'filter',
    'filter' => 'htmlspecialchars',
    'on' => ['create','modify']
],
</code>

展示文章的时候是没有问题的,但是编辑的时候
YII表单输出问题
ps:我展示的时候也没有进行htmlspecialchars_decode,直接:
= $article['content'] ?>
没有问题~
就想问下在yii的表单里应该怎么做?
表单代码:
= $form->field($model, 'content')->textarea(['rows' => 6,'style'=>'resize:vertical','id'=>'editor']) ?>

回复内容:

先上我的模型验证:

<code>[
    ['content','title','excerpt'],
    'filter',
    'filter' => 'htmlspecialchars',
    'on' => ['create','modify']
],
</code>

展示文章的时候是没有问题的,但是编辑的时候
YII表单输出问题
ps:我展示的时候也没有进行htmlspecialchars_decode,直接:
= $article['content'] ?>
没有问题~
就想问下在yii的表单里应该怎么做?
表单代码:
= $form->field($model, 'content')->textarea(['rows' => 6,'style'=>'resize:vertical','id'=>'editor']) ?>

Html::decode($var) ?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn